-
The Universe
@RESTThe ExoAPI is a powerful tool that provides access to exoplanet data through a simple RESTful API. Below is an interactive exploration of thirty planets pulled entirely using the API. If you are interested in developing using ExoAPI visit our docs page.
-
ExoAPI:
SkyHook Documentation
The new skyhook API (version 2 of the original API) can be reached using http://exoapi.com/api/skyhook/ The old API will remain accessible at the old url.
Get Planets
You can request all of the current ExoPlanetary data using /planets/all. These queries can also be modified by the sort and fields operators.
All Planets skyhook/planets/all
Planets By Id skyhook/planets/[id]
Search Planets
You can search planets using the fieldname=value parameters on /planets/search? These queries can also be modified using the sort and fields operators.
For instance to find all planets discovered in 2012:
skyhook/planets/search?discoveryyear=2012You can also use :gt, :gte, :lt, :lte to execute range style queries. for example to find all planets discovered before 2007:
skyhook/planets/search?discoveryyear:lt=2007Sorting Results
Results can be sorted using the sort parameter:
skyhook/planets/all?sort=[field[:asc|:desc]]For example, to sort all planets by mass, descending:
skyhook/planets/all?sort=[properties.mass:desc]If no directionality is specified, ascending is used for example you can sort the planets by mass asc simply by using:
skyhook/planets/all?sort=[properties.mass]You can also use multiple sorting parameters by using comma as a delimiter:
skyhook/planets/all?sort=[discoveryyear:desc,name]Note: Not all planets have values for all fields. Currently in the API null values are returned as the greatest value. So a desc sort may return some results with null values for that field as the first several entries.
Selecting Specific Fields
If you do not want the full output with all planetary information, you can select specific fields that should be returned by the API, for example, to select only the names of planets use:
skyhook/planets/all?fields=[name]Note: The _id field is returned in all queries, the above query would return {name, _id} fields for each entry in the API
Fields should be separated by a comma, to select name and mass from planets with mass > 5, ordered by mass use the following search query:
skyhook/planets/search?properties.mass:gte=5&fields=[name,properties.mass]&sort=[properties.mass]Current Field List:
This is the current list of fields in the database. Note this document may go out of date and more fields may be available (or unavailable if removed). For more information on the format of the underlying data, see here (https://github.com/hannorein/open_exoplanet_catalogue/tree/master/data).
_id name name_kepler name_koi zone_class mass_class composition_class atmosphere_class hydrogen-rich habitable_class min_mass mass radius density gravity esc_vel sflux_min sflux_mean sflux_max teq_min teq_mean teq_max ts_min ts_mean ts_max surf_press appar_size period sem_major_axis eccentricity mean_distance inclination omega hzd hzc hza hzi sph surf_esi esi habitable hab_moon confirmed disc_method disc_year image imagedescription multiplicity disc_method Star Properties star.name star.name_hd star.name_hip star.constellation star.type star.mass star.radius star.teff star.luminosity star.metallicity star.age star.appar_mag star.distance star.ra star.dec star.mag_from_planet star.no_planets star.no_planets_hz star.hab_zone_min star.habcat star.angulardistance star.magV star.magI star.magH star.magJ star.magK Paging:
You may not always want all planets to be returned in your query. To limit the number of results returned by your queries, use limit=[start,count]. For example to return the first 10 planets ordered by name use:
skyhook/planets/all?sort=[name], limit=10You can also apply an offset to begin from other points in the data, for example to access the 10 - 20 range, use the following query:
skyhook/planets/all?sort=[name], limit=10, start=10Example Queries:
To find the names of all planets with a mass less than 5, discovered this year (2012), sorted by mass ascending:
skyhook/planets/search?properties.mass:lt=5&discoveryyear=2012&sort=[properties.mass]&fields=[name]Response Format:
The API responses are JSON objects with the following format:
{ "response": { "results": [ {field:value, field2:value2 … } ], "count": 100 } }
CORS and JSONP:
Although ExoAPI provides access through Cross-Origin Resource Sharing we also allow support for JSONP requests. We reccommend using CORS, which can be used with the following jQuery command:
$.get("http://exoapi.com/api/planets/all", {}, function(data){ alert(data); });
JSONP-Style callbacks can be specified using the jsonp=[callbackName] query parameter. For example: http://exoapi.com/api/planets/all?jsonp=callback. This will return the following result format:
callback( { "response": { "results": [ {field:value, field2:value2 … } ], "count": 100 } }) -
About
ExoAPI is an ongoing project that extends the accessibility of exoplanetary data by providing an easy to use RESTful API. ExoAPI was created during the NASA Space Apps Challenge [spaceappschallenge.org] by a team of three amazing geniuses who knew nothing about space before they started this...and still don't really.
Currently the data is provided by http://exoplanetology.blogspot.com/ who in turn feeds the data from http://exoplanet.eu/. The ExoAPI team plans on extending the API to encompass a wider array of data sources and more interesting space data to reach as many programmers as possible and encourage an explosion of space data based mashups.
The new SKYHOOK API integrates another data source (http://nanobio.hpcf.upr.edu/~amendez/phl/phl_hec_all_confirmed.csv) to provide a much wider range of available fields, see the docs for more info.
Email us and send us your mash-ups and projects! We'd love to see how you're using the ExoAPI.
Who Made this?
Ken "likes turtles"
Rob is an interactive developer/designer and is entirely too humble.
Marissa is a front-end developer who makes stuff for the interwebs. -