REST API
Programmatic access to the neutron star catalog. Free, no authentication required, updated weekly. Suitable for Python scripts, Jupyter notebooks, and research pipelines.
Base URL
https://neutron-star-api.mistyck.workers.dev
No rate limiting for reasonable use. All responses include CORS headers — the API can be called directly from browser JavaScript. Data is cached for 1 hour per worker instance. Updated every Monday from ATNF and McGill.
Endpoints
GET
/
API info and available endpoints
GET
/stats
Catalog statistics by type and catalog
GET
/search?name=
Search objects by name (regex supported)
| Parameter | Type | Description |
|---|---|---|
| name | string | Name or regex pattern to match against NS_NAME. Case insensitive. |
GET
/object?name=
Get a single object by exact name
| Parameter | Type | Description |
|---|---|---|
| name | string | Exact NS_NAME value. |
GET
/cone?ra=&dec=&radius=
Cone search — all objects within a radius of a sky position
| Parameter | Type | Description |
|---|---|---|
| ra | float | Right ascension in decimal degrees (0–360). |
| dec | float | Declination in decimal degrees (-90 to +90). |
| radius | float | Search radius in degrees. Default: 1.0. |
GET
/catalog?type=&catalog=&galaxy=&limit=&offset=
Filtered catalog with pagination
| Parameter | Type | Description |
|---|---|---|
| type | string | Object type: pulsar, magnetar, candidate_magnetar, pulsar_outburst_2006, M7 isolated neutron star, central compact object (CCO). |
| catalog | string | Source catalog: ATNF or McGill. |
| galaxy | string | Galaxy: milky_way, lmc, smc. |
| limit | int | Max results to return. Default: 100. |
| offset | int | Pagination offset. Default: 0. |
GET
/types
List all available object types
Python examples
No dependencies beyond requests. Compatible with Python 3.7+.
import requests
BASE = "https://neutron-star-api.mistyck.workers.dev"
# --- Catalog statistics ---
stats = requests.get(f"{BASE}/stats").json()
print(stats["total"], "objects")
# --- Search by name (regex) ---
results = requests.get(f"{BASE}/search", params={"name": "^J0534"}).json()
for obj in results["results"]:
print(obj["NS_NAME"], obj["DIST"], "kpc")
# --- Cone search around the Crab pulsar ---
crab_region = requests.get(f"{BASE}/cone", params={
"ra": 83.8, "dec": 22.0, "radius": 5.0
}).json()
print(crab_region["count"], "objects within 5 degrees")
# --- Get all magnetars as a DataFrame ---
import pandas as pd
r = requests.get(f"{BASE}/catalog", params={"type": "magnetar", "limit": 500}).json()
df = pd.DataFrame(r["results"])
print(df[["NS_NAME", "P", "PDOT", "DIST"]])
# --- Paginate through full catalog ---
all_objects = []
offset = 0
while True:
page = requests.get(f"{BASE}/catalog", params={"limit": 500, "offset": offset}).json()
all_objects.extend(page["results"])
if len(all_objects) >= page["total"]: break
offset += 500
print(len(all_objects), "total objects loaded")