# Star Map Generator: Night Sky Poster for Any Date & Place (`jumblemog/star-map-generator`) Actor

Draw the night sky as it was over any place at any date and time: a print-ready star map poster (PNG and SVG) with constellations, the Milky Way, planets and the Moon's phase, plus the sky's facts as JSON. For gifts, print shops, apps and AI agents.

- **URL**: https://apify.com/jumblemog/star-map-generator.md
- **Developed by:** [Jumble Mog](https://apify.com/jumblemog) (community)
- **Categories:** Developer tools, AI, E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

## Star Map Generator: Night Sky Poster for Any Date & Place

**Draw the night sky exactly as it was over any place on any date, as a print-ready poster.** Give a city and a date (a wedding, a birth, a first date, tonight) and you get back:

- **A star map as PNG and SVG**: the stars you could see with the naked eye, the 88 constellations' figures and names, the Milky Way, the planets, and the Moon in its real phase, with your title and subtitle, the place, the date and the coordinates set under it.
- **Five styles and three layouts**: midnight blue, black, white (ink on paper), vintage (navy on cream) and forest green; a 3:4 poster with a title block, a square, or the round map alone with transparent corners for your own design.
- **The facts behind the picture** as data: the Moon's phase and how much of it was lit, which planets were up and where, the ten brightest stars with their height and direction, the constellations above the horizon, sidereal time, and whether it was night, twilight or day.

![Three star map posters made by this Actor: the sky over Paris on 14 July 2019 in midnight blue with the title The Night We Met, over Sydney on 25 December 2024 in black, and over Reykjavik on 24 December 2023 in the vintage style, each with constellations, the Milky Way, planets and the Moon](https://api.apify.com/v2/key-value-stores/Km5b4PG3kYHdZSb1E/records/star-map-generator-example.png?signature=1bsoPDcYNZar461c6YHMc)

The sky is computed, not looked up from a template: every star and planet is placed for that latitude, longitude and minute, so two maps are only alike if the place and moment are.

It's made for:

- Print-on-demand shops and gift sellers who need a custom star map for each order from Shopify, Etsy or WooCommerce, without a designer or a subscription to a poster app.
- Developers who want a star map API: one request with a place and a date, one image back.
- AI agents and chatbots asked "what did the sky look like the night I was born?" that need a picture and the facts to describe it.
- Teachers, astronomy clubs and writers who want to know what was up on a given night.

### How to use it

1. Write the **Place**: a city, with its country or US state if the name is common (`Paris, France`, `Portland, Oregon`), or coordinates (`48.8566, 2.3522`).
2. Write the **Date**, and the **Time** if you know it. Without a time, the map is for 22:00.
3. Optionally add a **Title** and a **Subtitle**, and pick a **Style** and **Layout**.
4. Click **Start**. Each map is a row in the results with links to its files.

To draw many maps in one run, list them under **More maps**, one line each: `Paris, France | 2019-07-14 22:30 | The Night We Met | a subtitle`.

### Examples

- `{"place": "Paris, France", "date": "2019-07-14", "time": "22:30", "title": "The Night We Met"}` → a midnight-blue poster and "The sky over Paris on 14 July 2019 at 22:30: 1302 stars drawn in 44 constellations, a waxing gibbous Moon (95.9% lit) in Sagittarius, with Mars, Jupiter, Saturn up. Brightest star: Arcturus."
- `{"maps": ["Sydney | 2024-12-25 21:00 | Christmas Down Under"]}` → the southern sky with Sirius brightest, Venus, Jupiter and Saturn up, and the Moon (a waning crescent, 27.6% lit) below the horizon.
- `{"place": "New York", "date": "July 4, 1976 9pm", "style": "vintage", "layout": "circle"}` → the round map alone on a transparent background: a first quarter Moon in Virgo, with Mars beside Regulus in Leo.

### How-to examples

The result lines are from runs of these inputs.

#### How to make a star map for a date and place

```json
{"place": "Paris, France", "date": "2019-07-14", "time": "22:30", "title": "The Night We Met", "subtitle": "Under these stars, everything began"}
```

Result: a 2400 × 3200 pixel poster at `imageUrl`, with `caption` "Paris, France · 14 July 2019 · 22:30", `moon.phase` "Waxing Gibbous" in Sagittarius, and `visiblePlanets` Mars, Jupiter and Saturn.

#### How to generate star map posters in bulk for a print shop

```json
{"maps": ["Paris, France | 2019-07-14 22:30 | The Night We Met", "Sydney | 2024-12-25 21:00 | Christmas Down Under", {"place": "Reykjavik", "date": "2023-12-24", "time": "23:00", "title": "Our First Winter", "style": "white"}], "outputs": ["png", "svg"], "imageWidth": 5400}
```

Result: three rows, each with a PNG 5400 pixels wide (18 × 24 inches at 300 dpi) and an SVG that prints at any size. Each entry can have its own style and layout; a line that can't be drawn (a misspelled city, say) comes back as a failed row with the reason, and isn't charged.

#### How to see what the night sky looked like on the day you were born

```json
{"place": "Houston, Texas", "date": "20 July 1969", "time": "9:30pm", "layout": "square", "grid": true}
```

Result: the map for that evening, and in the data a waxing crescent Moon (about a third lit), which planets were up, the brightest stars with their directions and the constellations above the horizon. Leave the time out if you don't know it and the map is for 22:00, with a note saying so.

#### How to let an AI agent draw and describe a night sky

Add this Actor to the [Apify MCP server](https://mcp.apify.com) with `https://mcp.apify.com/?tools=jumblemog/star-map-generator`. The agent passes a place and a date and reads `summary`, `moon`, `visiblePlanets` and `brightestStars` to describe the sky in words, and can show `imageUrl`, instead of guessing at astronomy from memory.

### FAQ

**Is the star map accurate?** Yes. Positions come from the PyEphem astronomy library (planets by the VSOP87 theory, stars precessed to the date), for the exact latitude, longitude and minute. The Moon's phase and the planets match what observatory software shows for the same moment.

**What if I don't know the exact time?** Leave it empty. The map is drawn for 22:00 local time and the result says so. The stars turn by about 15° an hour, so an evening map still shows the right constellations for that night.

**Which places does it know?** About 34,000 cities and towns of 15,000 people or more, with their time zones, under their English and local names (`Munich` or `München`, `Tokyo` or `東京`). For a village, a beach or a mountain top, give coordinates: the time zone is taken from the nearest listed town.

**Does it handle time zones and daylight saving time?** Yes. The time you give is local time at the place, with summer time applied for that date, back to the start of time zone records. Set `timezone` only to override it.

**Why does the map say twilight or daylight?** Because the sky is drawn for the time you gave. At 22:30 in Paris in July the Sun has only just set. The stars were all there, and the poster shows them all; the `notes` tell you the real sky was still bright.

**Why is east on the left?** A star map is the view looking up, not down at the ground. Hold it over your head with N toward north and east falls to your left, matching the sky.

**Can I sell the posters?** Yes. The images are yours to use, including commercially. The star and constellation data is open (BSD license) and the fonts are open (SIL Open Font License).

**How big can I print?** The SVG is vector and prints at any size. For PNG, set the width: 5400 pixels gives 18 × 24 inches at 300 dpi, and the largest (7200) gives 24 × 32 inches.

**Does it work with Zapier, Make or n8n?** Yes. Call the Actor with its Apify app or an HTTP request when an order comes in, and pass `imageUrl` on to your print provider.

### Input

| Field | What it is |
|---|---|
| `place` | A city (`Paris, France`, `Springfield, IL`) or coordinates (`48.8566, 2.3522`) |
| `date` | The date: `2019-07-14`, `14 July 2019`, `July 14, 2019`. It may hold the time too |
| `time` | Local time at the place: `22:30` or `10:30pm` (22:00 if empty) |
| `title`, `subtitle` | The lines under the map (the title is "The Night Sky" if empty) |
| `maps` | More maps: lines of `place \| date time \| title \| subtitle`, or objects with `place` (or `latitude` and `longitude`), `date`, `time`, `timezone`, `title`, `subtitle`, `placeLabel`, `style`, `layout` |
| `style` | `midnight` (default), `black`, `white`, `vintage` or `forest` |
| `layout` | `poster` (3:4 with title block, default), `square` or `circle` (the map alone) |
| `outputs` | `png` (default), `svg`, or both |
| `imageWidth` | Width of the PNG in pixels (2400 by default, 300 to 7200) |
| `magnitudeLimit` | Faintest stars drawn: `4` (a city sky) to `6` (every naked-eye star); `5.5` by default |
| `constellations`, `constellationNames`, `starNames`, `planets`, `moon`, `milkyWay`, `compass` | Switches for each layer, all on by default |
| `grid` | Altitude circles and direction lines (off by default) |
| `clock` | `24` (22:30, default) or `12` (10:30 PM) |
| `hideTime` | Leave the time off the poster |
| `timezone` | Override the place's time zone: `Europe/Paris` or `+02:00` |
| `maxMaps` | Stop after this many maps (100 by default) |

In an object under `maps`, `placeLabel` replaces the place line on the poster ("Our garden, Lyon"), and `latitude` and `longitude` with a `place` name draw the sky for the exact spot under the name you chose.

### Output

One dataset item per map. The first map is also saved as the run's `OUTPUT` record:

```json
{
  "index": 1, "status": "ok",
  "title": "The Night We Met", "subtitle": "Under these stars, everything began",
  "caption": "Paris, France · 14 July 2019 · 22:30",
  "summary": "The sky over Paris on 14 July 2019 at 22:30: 1302 stars drawn in 44 constellations, a waxing gibbous Moon (95.9% lit) in Sagittarius, with Mars, Jupiter, Saturn up. Brightest star: Arcturus.",
  "place": {"name": "Paris", "country": "France", "latitude": 48.85341, "longitude": 2.3488, "matched": "Paris, France (population 2,138,551)"},
  "localTime": "2019-07-14T22:30+02:00", "utcTime": "2019-07-14T20:30Z", "timezone": "Europe/Paris",
  "siderealTime": "16:09:03", "sky": "civil twilight", "sunAltitude": -5.87,
  "moon": {"altitude": 14.75, "azimuth": 154.71, "direction": "SSE", "illuminatedPercent": 95.9, "phase": "Waxing Gibbous", "constellation": "Sagittarius", "up": true},
  "planets": [{"name": "Jupiter", "altitude": 18.13, "azimuth": 168.09, "direction": "SSE", "magnitude": -2.4, "constellation": "Ophiuchus", "up": true}, "..."],
  "visiblePlanets": ["Mars", "Jupiter", "Saturn"],
  "brightestStars": [{"name": "Arcturus", "magnitude": -0.05, "altitude": 52.6, "azimuth": 227.2, "direction": "SW"}, "..."],
  "constellationsUp": ["Andromeda", "Aquila", "Boötes", "..."], "starsDrawn": 1302,
  "style": "midnight", "layout": "poster",
  "notes": ["The sky was in civil twilight at this time, so only the brighter stars were out."],
  "imageUrl": "https://api.apify.com/v2/key-value-stores/.../records/001-Paris-2019-07-14.png",
  "svgUrl": null
}
```

Altitude is degrees above the horizon and azimuth is degrees from north through east. `planets` lists all seven with where they were, up or not; `visiblePlanets` are those above the horizon and bright enough to see without a telescope. A map that can't be drawn has `"status": "failed"` and the reason in `error`, and isn't billed.

### How it works

1. **Find the place** among GeoNames cities (or read the coordinates) and take its time zone.
2. **Fix the moment**: your local date and time, with daylight saving time for that date, converted to universal time.
3. **Compute the sky** with [PyEphem](https://rhodesmill.org/pyephem/): the altitude and azimuth of 5,044 stars down to magnitude 6, the planets, the Sun and the Moon with its phase.
4. **Draw** everything above the horizon in a stereographic projection (which keeps the constellations' shapes), with the zenith in the middle, north at the top and the lit side of the Moon turned toward the Sun, then set the title block and rasterize with [resvg](https://github.com/linebender/resvg).

### Pricing

You pay one low price per map, at the price shown on this page, whatever style, size and formats you pick. Requests that can't be drawn are never charged. If you set a maximum cost per run, the Actor stops before a map that wouldn't fit.

### Speed

A map takes one to two seconds at the default size, about 6 at 5400 pixels wide and about 11 at the largest size. A run through the API adds a few seconds for the cloud container to start.

### Tips and limits

- **Common city names** need a country or state: `Paris` is Paris, France (the largest of that name); write `Paris, Texas` for the other. The `place.matched` field shows which city was used.
- **Small places** (under 15,000 people) aren't listed; give coordinates and a `place` name or `placeLabel` to print.
- **Uranus and Neptune** are in the data but not drawn, because you can't see them without a telescope. Comets, satellites and meteor showers aren't included.
- **The horizon is ideal**: no hills, buildings or bending of light by the air, so objects within a degree of the rim may have been just out of sight.
- **Old and far dates** work, from year 1 to 9998. Dates before 15 October 1582 are read in the Julian calendar, as history books write them. Stars are placed without their own slow drift (proper motion), which stays under the width of a star's dot within about five centuries of today.
- **Text that's too long** for the poster is shrunk to fit; titles under 30 characters look best. Titles can be in Latin, Greek, Cyrillic, Chinese, Japanese, Korean, Hebrew or Arabic letters; the place and date lines are in English.
- **Memory**: the default 4 GB draws every size. The largest PNG (7200 pixels wide) needs about 1 GB, so don't run that size with less than 2 GB.
- **Fonts**: titles are set in EB Garamond and labels in Lato. The SVG names those fonts and doesn't carry them, so install them (both free) where you open or print it, or use the PNG.

### For AI agents and developers

- **Input**: a place and a date are enough. Everything else has a default.
- **Output**: `summary` says the sky in a sentence; `moon`, `visiblePlanets`, `brightestStars` and `constellationsUp` are the facts; `imageUrl` is the picture.
- **Errors**: an unknown place or unreadable date gives `status` "failed" with a sentence in `error` that says what to change.
- **Cost**: one event per map drawn, nothing for failures.

Get the map's data from one HTTP call:

```bash
curl -X POST "https://api.apify.com/v2/acts/jumblemog~star-map-generator/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"place": "Paris, France", "date": "2019-07-14", "time": "22:30", "title": "The Night We Met"}'
```

`run-sync` instead returns the run's `OUTPUT`: the first map as a PNG, ready to save as a file.

In Python, with the `apify-client` package:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("jumblemog/star-map-generator").call(run_input={
    "maps": ["Paris, France | 2019-07-14 22:30 | The Night We Met", "Sydney | 2024-12-25 21:00"],
    "style": "vintage", "outputs": ["png", "svg"],
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["summary"], item["imageUrl"])
```

### Credits

- Star, constellation and Milky Way data: [d3-celestial](https://github.com/ofrohn/d3-celestial) by Olaf Frohn (BSD license), which draws on the XHIP extended Hipparcos star catalog (Anderson and Francis, 2012) and Jose R. Vieira's Milky Way Outline Catalog.
- Astronomy: [PyEphem](https://rhodesmill.org/pyephem/) (MIT), built on XEphem's routines.
- Places and time zones: [GeoNames](https://www.geonames.org/) (CC BY 4.0) through [geonamescache](https://github.com/yaph/geonamescache) (MIT).
- Fonts: EB Garamond, Lato and Noto Sans CJK (SIL Open Font License), with DejaVu for other scripts.
- Rasterizing: [resvg](https://github.com/linebender/resvg) (Apache-2.0 or MIT) through [resvg-py](https://github.com/baseplate-admin/resvg-py) (MIT).

# Actor input Schema

## `place` (type: `string`):

A city, with its country or US state if the name is common (Paris, France; Portland, Oregon; Springfield, IL), or coordinates (48.8566, 2.3522). Cities of 15,000 people or more are known; for a village, use coordinates or the nearest town.

## `date` (type: `string`):

The date, such as 2019-07-14, 14 July 2019 or July 14, 2019. Any year from 1 to 9998.

## `time` (type: `string`):

Local time at the place, such as 22:30 or 10:30pm. Left empty, the map is for 22:00.

## `title` (type: `string`):

The large line under the map. Left empty: The Night Sky.

## `subtitle` (type: `string`):

A smaller line under the title: names, a quote, a dedication.

## `maps` (type: `array`):

A list of maps to draw in one run. Each is a line of text, "Paris, France | 2019-07-14 22:30 | The Night We Met | a subtitle", or an object with place (or latitude and longitude), date, time, timezone, title, subtitle, placeLabel, style and layout.

## `style` (type: `string`):

The poster's colors.

## `layout` (type: `string`):

Poster is 3:4, the shape of 18 × 24 inch and 30 × 40 cm prints. Square and circle are the map alone, for your own layout.

## `outputs` (type: `array`):

PNG for screens and most print shops; SVG scales to any print size. The price per map is the same whatever you pick.

## `imageWidth` (type: `integer`):

2400 is sharp on screens and prints well to about 8 inches wide; 5400 gives an 18 × 24 inch print at 300 dpi.

## `magnitudeLimit` (type: `string`):

How faint the stars go. About half of them are above the horizon at any moment.

## `constellations` (type: `boolean`):

Draw the 88 constellations' figures.

## `constellationNames` (type: `boolean`):

Label the larger constellations.

## `starNames` (type: `boolean`):

Label the brightest stars, such as Vega and Sirius.

## `planets` (type: `boolean`):

Mark Mercury, Venus, Mars, Jupiter and Saturn when they're up.

## `moon` (type: `boolean`):

Draw the Moon with its phase when it's up.

## `milkyWay` (type: `boolean`):

Shade the Milky Way.

## `grid` (type: `boolean`):

Draw altitude circles and direction lines.

## `compass` (type: `boolean`):

Mark N, E, S and W around the map.

## `clock` (type: `string`):

How the time is written under the map.

## `hideTime` (type: `boolean`):

Show only the place and date under the map.

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

Only if you need to override the place's own time zone: an IANA name (Europe/Paris) or an offset (+02:00). Daylight saving time is applied for the date.

## `maxMaps` (type: `integer`):

Stop after this many maps.

## Actor input object example

```json
{
  "place": "Paris, France",
  "date": "2019-07-14",
  "time": "22:30",
  "title": "The Night We Met",
  "subtitle": "Under these stars, everything began",
  "style": "midnight",
  "layout": "poster",
  "outputs": [
    "png"
  ],
  "imageWidth": 2400,
  "magnitudeLimit": "5.5",
  "constellations": true,
  "constellationNames": true,
  "starNames": true,
  "planets": true,
  "moon": true,
  "milkyWay": true,
  "grid": false,
  "compass": true,
  "clock": "24",
  "hideTime": false,
  "maxMaps": 100
}
```

# Actor output Schema

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

One item per map: the poster's links, the place and time used, the Moon, planets and stars.

## `files` (type: `string`):

The PNG and SVG files saved in the run's key-value store.

# 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 = {
    "place": "Paris, France",
    "date": "2019-07-14",
    "time": "22:30",
    "title": "The Night We Met",
    "subtitle": "Under these stars, everything began"
};

// Run the Actor and wait for it to finish
const run = await client.actor("jumblemog/star-map-generator").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 = {
    "place": "Paris, France",
    "date": "2019-07-14",
    "time": "22:30",
    "title": "The Night We Met",
    "subtitle": "Under these stars, everything began",
}

# Run the Actor and wait for it to finish
run = client.actor("jumblemog/star-map-generator").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 '{
  "place": "Paris, France",
  "date": "2019-07-14",
  "time": "22:30",
  "title": "The Night We Met",
  "subtitle": "Under these stars, everything began"
}' |
apify call jumblemog/star-map-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jumblemog/star-map-generator"
        }
    }
}
```

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/MGw6vk5NOPDDhxqEt/builds/wa3osEFUVwblNnTHU/openapi.json
