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, so the API can be called directly from browser JavaScript. Data is cached for 1 hour per worker instance. Updated every Monday from ATNF, McGill, the XRBcats X-ray binary catalogues and the Magellanic Cloud HMXB catalogues, plus the Magnificent Seven, CCO and literature samples. The API serves the same table as The Catalog, including objects without a known distance.
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. URL-encode it: a literal + in a query string is read as a space, so J0534+2200 must be sent as J0534%2B2200 (Python requests does this for you when you pass params=). |
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), high-mass X-ray binary (NS), low-mass X-ray binary (NS), ULX pulsar, SN 1987A compact object (candidate). |
| catalog | string | Source catalog: ATNF, McGill, SIMBAD Magnificent Seven, SIMBAD CCOs, XRBcats HMXB, XRBcats LMXB, SMC HMXB (Haberl+2016), LMC HMXB (eRASS1), Literature. |
| galaxy | string | Galaxy: milky_way, lmc, smc, or the host galaxy name for ULX pulsars beyond the Magellanic Clouds (e.g. M82). Set for objects with a usable distance (the ones shown in the 3D visualizer) and for those ULX pulsars; otherwise galaxy: null. |
| 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")