MPC Summary API¶
This tutorial shows practical usage patterns for the Minor Planet Center's Summary API endpoint.¶
This notebook focuses on calling /summary/overall for time-bounded summaries and latest-only retrieval.
Reference documentation for full endpoint details is available at:
https://docs.minorplanetcenter.net/mpc-ops-docs/apis/summary
In the examples below we use Python code to query the API.
Import Packages¶
Here we import the standard Python packages needed to call the API and inspect the returned data.
import datetime as dt
import requests
import json
API_URL = "https://data.minorplanetcenter.net/api/summary/overall"
Workflow Overview¶
In this notebook we use two common workflows:
- Query summaries for a specified time window
- Request only the latest available summary (
limit=1)
Helper Function¶
A small helper keeps the API calls consistent across examples.
def fetch_summary(payload: dict):
response = requests.post(API_URL, json=payload, timeout=60)
response.raise_for_status()
return response.json()
Query by Time Window¶
This example uses both start_time and cutoff_time in ISO8601 UTC format to retrieve summaries for a specific time window.
start_time = dt.datetime(2026, 1, 1, tzinfo=dt.timezone.utc)
cutoff_time = dt.datetime(2026, 1, 10, tzinfo=dt.timezone.utc)
payload = {
"start_time": start_time.isoformat(),
"cutoff_time": cutoff_time.isoformat(),
}
records = fetch_summary(payload)
print(f"Records returned: {len(records)}")
if records:
print("First record snippet:")
print(json.dumps(records[0], indent=2)[:1200])
Query Latest Summary¶
This example requests only the latest available summary by setting limit=1. Note that this is also the default for the endpoint.
latest_records = fetch_summary({"limit": 1})
latest_summary = latest_records[0] if latest_records else None
print(json.dumps(latest_summary, indent=2)[:1200] if latest_summary else "No records returned")
Conclusion¶
The Summary API can provide information on the MPC's data holdings. This tutorial demonstrated:
- Time-window queries using start_time and cutoff_time
- Latest-only queries using limit=1
For parameter defaults and endpoint reference, see the full API documentation.