{"openapi":"3.1.0","info":{"title":"Exoplanets Catalog API","description":"REST API for querying the NASA Exoplanet Archive data. Provides access to stellar hosts and exoplanets with pagination, sorting, and column selection.","license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"},"version":"1.0.0"},"paths":{"/rest/exoplanets":{"get":{"tags":["data"],"summary":"Get exoplanets data","description":"Returns paginated exoplanet data with optional sorting and column selection.\nDefault columns: pl_name, hostname, discoverymethod, disc_year, pl_orbper, pl_rade, pl_bmasse","operationId":"get_exoplanets","parameters":[{"name":"page","in":"query","description":"Page number (1-indexed, default: 1)","required":false,"schema":{"type":["integer","null"],"minimum":0},"example":1},{"name":"limit","in":"query","description":"Number of rows per page (default: 50, max: 1000)","required":false,"schema":{"type":["integer","null"],"minimum":0},"example":50},{"name":"sort_by","in":"query","description":"Column name to sort by","required":false,"schema":{"type":["string","null"]},"example":"hostname"},{"name":"order","in":"query","description":"Sort order: \"asc\" or \"desc\" (default: \"asc\")","required":false,"schema":{"type":["string","null"]},"example":"asc"},{"name":"columns","in":"query","description":"Comma-separated list of columns to return","required":false,"schema":{"type":["string","null"]},"example":"hostname,sy_dist,st_teff"},{"name":"filter","in":"query","description":"Text filter applied to the first selected column","required":false,"schema":{"type":["string","null"]},"example":"Kepler"}],"responses":{"200":{"description":"Exoplanets data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"500":{"description":"Internal server error"}}}},"/rest/exoplanets/schema":{"get":{"tags":["schema"],"summary":"Get exoplanets schema","description":"Returns column metadata for the exoplanets table including column names,\ndata types, descriptions, and units.","operationId":"get_exoplanets_schema","responses":{"200":{"description":"Exoplanets schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaResponse"}}}}}}},"/rest/query":{"get":{"tags":["sql"],"summary":"Execute a SQL query against the registered tables.","description":"Tables: stellarhosts, exoplanets","operationId":"execute_sql","parameters":[{"name":"sql","in":"query","description":"SQL query to execute (SELECT only)","required":true,"schema":{"type":"string"},"example":"SELECT pl_name, hostname, disc_year FROM exoplanets LIMIT 10"},{"name":"limit","in":"query","description":"Maximum number of rows to return (default: 1000, max: 10000)","required":false,"schema":{"type":["integer","null"],"minimum":0},"example":1000}],"responses":{"200":{"description":"SQL query result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SqlResponse"}}}},"400":{"description":"Invalid SQL query"},"408":{"description":"SQL query timed out"},"500":{"description":"Internal server error"}}}},"/rest/stellarhosts":{"get":{"tags":["data"],"summary":"Get stellar hosts data","description":"Returns paginated stellar host data with optional sorting and column selection.\nDefault columns: hostname, sy_dist, st_teff, st_mass, sy_pnum","operationId":"get_stellarhosts","parameters":[{"name":"page","in":"query","description":"Page number (1-indexed, default: 1)","required":false,"schema":{"type":["integer","null"],"minimum":0},"example":1},{"name":"limit","in":"query","description":"Number of rows per page (default: 50, max: 1000)","required":false,"schema":{"type":["integer","null"],"minimum":0},"example":50},{"name":"sort_by","in":"query","description":"Column name to sort by","required":false,"schema":{"type":["string","null"]},"example":"hostname"},{"name":"order","in":"query","description":"Sort order: \"asc\" or \"desc\" (default: \"asc\")","required":false,"schema":{"type":["string","null"]},"example":"asc"},{"name":"columns","in":"query","description":"Comma-separated list of columns to return","required":false,"schema":{"type":["string","null"]},"example":"hostname,sy_dist,st_teff"},{"name":"filter","in":"query","description":"Text filter applied to the first selected column","required":false,"schema":{"type":["string","null"]},"example":"Kepler"}],"responses":{"200":{"description":"Stellar hosts data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"500":{"description":"Internal server error"}}}},"/rest/stellarhosts/schema":{"get":{"tags":["schema"],"summary":"Get stellar hosts schema","description":"Returns column metadata for the stellar hosts table including column names,\ndata types, descriptions, and units.","operationId":"get_stellarhosts_schema","responses":{"200":{"description":"Stellar hosts schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaResponse"}}}}}}}},"components":{"schemas":{"ApiResponse":{"type":"object","description":"Response structure for paginated data","required":["data","total","total_all","page","limit","columns"],"properties":{"columns":{"type":"array","items":{"type":"string"},"description":"Column names in the response","example":["hostname","sy_dist","st_teff"]},"data":{"type":"array","items":{"type":"object"},"description":"Array of row objects"},"limit":{"type":"integer","description":"Rows per page","example":50,"minimum":0},"page":{"type":"integer","description":"Current page number","example":1,"minimum":0},"total":{"type":"integer","description":"Total rows matching query (after filtering, before pagination)","example":5000,"minimum":0},"total_all":{"type":"integer","description":"Total rows in entire dataset (unfiltered)","example":5000,"minimum":0}}},"ColumnInfo":{"type":"object","description":"Column metadata information","required":["name","data_type"],"properties":{"data_type":{"type":"string","description":"Data type (e.g., \"String\", \"Float64\", \"Int64\")","example":"String"},"description":{"type":["string","null"],"description":"Human-readable description of the column","example":"Host star name"},"name":{"type":"string","description":"Column name","example":"hostname"},"unit":{"type":["string","null"],"description":"Unit of measurement (if applicable)","example":"parsec"}}},"SchemaResponse":{"type":"object","description":"Response structure for schema endpoint","required":["columns","total_rows"],"properties":{"columns":{"type":"array","items":{"$ref":"#/components/schemas/ColumnInfo"},"description":"List of columns with their metadata"},"total_rows":{"type":"integer","description":"Total rows in the table","example":5000,"minimum":0}}},"SqlResponse":{"type":"object","description":"Response structure for SQL query","required":["data","rows","columns","query"],"properties":{"columns":{"type":"array","items":{"type":"string"},"description":"Column names in the result","example":["pl_name","hostname","disc_year"]},"data":{"type":"array","items":{"type":"object"},"description":"Array of row objects"},"query":{"type":"string","description":"The SQL query that was executed"},"rows":{"type":"integer","description":"Number of rows returned","example":100,"minimum":0}}}}},"tags":[{"name":"data","description":"Data query endpoints"},{"name":"schema","description":"Schema information endpoints"},{"name":"sql","description":"SQL query endpoint"}]}