# Chicken Coop Daylight and Light Timer Planner (`standardwork/chicken-daylight-planner`) Actor

Daily sunrise, sunset and day length for your coop, plus exact light timer on and off times to keep hens at 14 to 16 hours of light, for a day or a full year.

- **URL**: https://apify.com/standardwork/chicken-daylight-planner.md
- **Developed by:** [Standard Work Co.](https://apify.com/standardwork) (community)
- **Categories:** Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Chicken Coop Daylight and Light Timer Planner

Informational only. Not for navigation, safety, emergency, financial, medical, or legal decisions. Check the official source before you rely on it.

Enter your coop's location and get, for every day: sunrise, sunset, day length, how it changed since yesterday, how much light to add to reach 14 to 16 hours, and the exact timer on and off times. Run 366 days for a full-year timer plan.

### What you get (one row per day)

Date, sunrise and sunset (ISO 8601 with offset and plain local time), civil dawn and dusk, day length in minutes and h:mm, change vs the day before, target hours, whether natural light is below target, minutes of light to add, and lights on and off times for your chosen mode (before sunrise, after sunset, or split). Self-check fields flag polar days and very short days where lights must start the night before.

### How it works

Sun times are computed from the JPL DE421 ephemeris with the Skyfield library (sunrise and sunset use the sun's upper edge with standard refraction, like published almanacs). No outside data feed, so it never goes stale. Light guidance follows extension advice: hens need about 14 hours of light to lay and should get no more than 16; add light before sunrise so they roost at natural dusk; if you add light after sunset, dim it over 30 to 45 minutes.

### How to use (no code)

1. Type your location name, latitude and longitude. 2. Pick target hours and when to add light. 3. Click Start (about 5 seconds).

### Disclaimer

Informational only. Not for navigation, safety, emergency, financial, medical, or legal decisions. Check the official source before you rely on it.
This is an independent tool by Standard Work Co. It is not affiliated with, endorsed by, or sponsored by any government agency or university named here. Names are used only to say where methods and guidance come from.
Provided "as is" with no warranty of any kind, including accuracy, completeness, or timeliness. Liability is limited as stated in the Apify Standard Actor Contract for this tool.
Not veterinary advice. Flock health, breed, age and molt affect laying; ask your vet or extension office about your flock.

### Credits

Sun math: Skyfield (rhodesmill.org/skyfield) with the JPL DE421 ephemeris. Light guidance: Penn State Extension ("What Do I Do with All These Eggs?") and University of Arizona Cooperative Extension ("Lighting Schedules for Arizona Backyard Laying Flocks"). Checked against the U.S. Naval Observatory sun data service.

# Actor input Schema

## `locationName` (type: `string`):

Label for the output.

## `latitude` (type: `string`):

Decimal degrees, e.g. 41.59

## `longitude` (type: `string`):

Decimal degrees, west is negative, e.g. -93.62

## `startDate` (type: `string`):

YYYY-MM-DD. Leave empty for today.

## `days` (type: `integer`):

1 to 366. 366 gives a full year.

## `targetHours` (type: `integer`):

Total light per day, 14 to 16 hours.

## `lightMode` (type: `string`):

Extension guidance favors adding light before sunrise so hens roost at natural dusk.

## `timezone` (type: `string`):

IANA name such as America/Chicago. Leave empty to detect from coordinates.

## Actor input object example

```json
{
  "locationName": "Des Moines, IA",
  "latitude": "41.59",
  "longitude": "-93.62",
  "days": 30,
  "targetHours": 14,
  "lightMode": "morning"
}
```

# Actor output Schema

## `results` (type: `string`):

All rows in the default dataset.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("standardwork/chicken-daylight-planner").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("standardwork/chicken-daylight-planner").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call standardwork/chicken-daylight-planner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,standardwork/chicken-daylight-planner"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/jKecfiK9CiR0qvcFh/builds/shhco2UePcBNEg7Lw/openapi.json
