MPC Catalog Codes API¶
This tutorial provides information on using the Minor Planet Center's Catalog Codes API.¶
The Minor Planet Center maintains a service to return catalog code mappings used in observation records.
This is useful when you want to, for example:
- Retrieve all catalog codes recognized by the MPC
- Look up a specific catalog code by ADES code
- Look up a specific catalog code by MPC1992 (
obs80) code
The Catalog Codes API is a REST endpoint. You can send POST requests to:
https://data.minorplanetcenter.net/api/catalog-codes
In the examples below we use Python to query the API.
Further information and documentation can be found here.
Import Packages¶
Here we import the standard Python packages needed to call the API and inspect the returned data.
In [ ]:
Copied!
import requests
import json
import requests
import json
In [ ]:
Copied!
response = requests.post(
"https://data.minorplanetcenter.net/api/catalog-codes",
json={}
)
response.raise_for_status()
print(json.dumps(response.json(), indent=4))
response = requests.post(
"https://data.minorplanetcenter.net/api/catalog-codes",
json={}
)
response.raise_for_status()
print(json.dumps(response.json(), indent=4))
Retrieve one catalog code by ADES code¶
If catalog_code_type is omitted, the API assumes ades_code.
In [ ]:
Copied!
payload = {"catalog_code": "NOMAD"}
response = requests.post(
"https://data.minorplanetcenter.net/api/catalog-codes",
json=payload
)
response.raise_for_status()
print(json.dumps(response.json(), indent=4))
payload = {"catalog_code": "NOMAD"}
response = requests.post(
"https://data.minorplanetcenter.net/api/catalog-codes",
json=payload
)
response.raise_for_status()
print(json.dumps(response.json(), indent=4))
Retrieve one catalog code by MPC1992 (obs80) code¶
Here we query for the obs80_code value "v".
In [ ]:
Copied!
payload = {"catalog_code": "v", "catalog_code_type": "obs80_code"}
response = requests.post(
"https://data.minorplanetcenter.net/api/catalog-codes",
json=payload
)
response.raise_for_status()
print(json.dumps(response.json(), indent=4))
payload = {"catalog_code": "v", "catalog_code_type": "obs80_code"}
response = requests.post(
"https://data.minorplanetcenter.net/api/catalog-codes",
json=payload
)
response.raise_for_status()
print(json.dumps(response.json(), indent=4))
Summary¶
The MPC Catalog Codes API provides access to catalog-code mappings used by the MPC.
Key points:
- Endpoint:
https://data.minorplanetcenter.net/api/catalog-codes - Method:
POST - Examples shown here: all codes, lookup by
ades_code, lookup byobs80_code
For complete request/response format details, see:
For questions or feedback, contact the MPC via the Jira Helpdesk.