SpaceDB API

SpaceDB API

1.0.0OAS 3.0

A REST API providing data on stars, planets, moons, and spacecraft. All endpoints require a bearer token. Read tokens grant GET access; write tokens grant full CRUD access.

API Base URL
  • Server 1:https://spacedb.cloud/api/v1

    Production

  • Server 2:http://spacedb.test/api/v1

    Local development

Security
bearerAuth (http)

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Additional Information
Contact

List all stars

get

Query Parameters

pageinteger

Example:1

per_pageinteger

<= 100

Example:25

Response

application/json

Paginated list of stars

dataarray[object]
Show Child Parameters
linksobject
Show Child Parameters
metaobject
Show Child Parameters
get/stars
 
application/json

Create a star

post

Body

application/json
namestringrequired
typestringrequired

Allowed values:main_sequencered_giantwhite_dwarfneutronsupergiant

mass_solarnumber
luminosity_solarnumber
temperature_kinteger
distance_lynumber
constellationstring
discovered_atstring(date)

Response

application/json

Star created

dataobject
Show Child Parameters
post/stars

Body

{ "name": "name", "type": "main_sequence" }
 
application/json

Get a star

get

Path Parameters

idintegerrequired

Response

application/json

Star details

dataobject
Show Child Parameters
get/stars/{id}
 
application/json