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)
ParameterTypeDescription
namestringName or regex pattern to match against NS_NAME. Case insensitive.
GET /object?name= Get a single object by exact name
ParameterTypeDescription
namestringExact NS_NAME value.
GET /cone?ra=&dec=&radius= Cone search — all objects within a radius of a sky position
ParameterTypeDescription
rafloatRight ascension in decimal degrees (0–360).
decfloatDeclination in decimal degrees (-90 to +90).
radiusfloatSearch radius in degrees. Default: 1.0.
GET /catalog?type=&catalog=&galaxy=&limit=&offset= Filtered catalog with pagination
ParameterTypeDescription
typestringObject type: pulsar, magnetar, candidate_magnetar, pulsar_outburst_2006, M7 isolated neutron star, central compact object (CCO).
catalogstringSource catalog: ATNF or McGill.
galaxystringGalaxy: milky_way, lmc, smc.
limitintMax results to return. Default: 100.
offsetintPagination 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")