Dataset

Description
REST endpoint to retrieve a Feature Collection of STAC Items from a Dataset Package. Items can be retrieved between a start and end date, and have an order specified.
Endpoint can be paginated or streamed. Streaming will stream the whole Feature Collection, as defined. Paginate will return up to 50 items of the Feature Collection per page, as defined.
URL
Endpoint Generation
It is simpler to generate the endpoint url from the Data Sphere Dashboard, via the Data Library.
Parameters
| Parameter | In | Required | Type | Default | Description |
|---|---|---|---|---|---|
package name |
path |
Required | string |
- | Your package name |
api type |
path |
Required | string |
- | Choose either paginate or stream response |
order |
query |
- | string |
new |
Define order of STAC Items, oldest (old) or newest (new) first |
from |
query |
- | string |
Earliest dataset package datetime | Earliest datetime to retrieve Items from package |
to |
query |
- | string |
Latest dataset package datetime | Latest datetime to retrieve Items from package |
Response
| Content Type |
|---|
text/event-stream; charset=utf-8 |
| Value | Type | Description |
|---|---|---|
STAC Item |
string (UTF-8) |
Returns UTF-8 JSON encoded string of STAC Items, seperated by a new line |
| Content Type |
|---|
application/json; charset=utf-8 |
| Parameter | Value | Type | Description |
|---|---|---|---|
type |
FeatureCollection |
string |
|
features |
Array[STAC Items] |
array |
Array of up to 50 STAC Items from dataset package |
links |
Array[LinkObject] |
array |
STAC compliant Link Object defining the href for self, next, prev FeatureCollection. |
| Code | Description |
|---|---|
400 |
Bad Request |
401 |
API Token is missing or invalid |
403 |
API Token is missing or invalid |
404 |
Invalid URL |
500 |
Internal Server Issue. Please report this to us here |
Usage
Stream
import requests
import json
session = requests.Session()
stac_items = list()
url = "https://datasphere.astrodynamic.space/api/dataset/v1/{package name}/stream/"
with session.get(url, headers={"Authorization":"Token {api token}"}, stream=True) as response:
for line in response.iter_lines():
if line:
stac_item = json.loads(line.decode())
stac_items.append(stac_item)
Paginate
Open API Docs
Dataset 1.0.0
Retrieve a Feature Collection of STAC Items from a Dataset Package. Items can be retrieved between a start and end date, and have an order specified. Endpoint can be paginated or streamed. Streaming will stream the whole Feature Collection, as defined. Paginate will return up to 50 items of the Feature Collection per page, as defined.
Servers
| Description | URL |
|---|---|
| Data Sphere REST Server | https://datasphere.astrodynamic.space/api |
Endpoints
GET /dataset/v1/{package name}/{api type}/?&order&from&to
REST endpoint to retrieve set of STAC Items from a Dataset Package.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
Authorization |
header | string | N/A | No | |
api type |
path | string | No | ||
from |
query | string | Earliest dataset package datetime | No | Earliest datetime to retrieve Items from package. |
order |
query | string | new | No | Define order of STAC Items, oldest or newest first. |
package name |
path | string | No | ||
to |
query | string | Latest dataset package datetime | No | Latest datetime to retrieve Items from package. |
Response 200 OK
{
"type": "Feature",
"bbox": [
{
"type": "float"
}
],
"properties": {},
"assets": {},
"links": [
{}
]
}
Schema of the response body
{
"type": "object",
"title": "STAC Item",
"description": "Basic STAC Item schema, full schema [here](https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json)",
"properties": {
"type": {
"type": "string",
"enum": [
"Feature"
]
},
"bbox": {
"type": "array",
"items": {
"type": "float"
}
},
"properties": {
"type": "object",
"properties": {}
},
"assets": {
"type": "object",
"properties": {}
},
"links": {
"type": "array",
"items": {
"type": "object",
"properties": {}
}
}
}
}
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"bbox": [
{
"type": "float"
}
],
"properties": {},
"assets": {},
"links": [
{}
]
}
],
"links": [
{
"rel": "string",
"href": "string",
"type": "application/json"
}
]
}
Schema of the response body
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"FeatureCollection"
]
},
"features": {
"type": "array",
"items": {
"$ref": "#/components/schemas/STACItem"
}
},
"links": {
"type": "array",
"items": {
"type": "object",
"properties": {
"rel": {
"type": "string",
"anyOf": {
"enum": [
"self",
"next",
"prev"
]
}
},
"href": {
"type": "string",
"format": "uri"
},
"type": {
"type": "string",
"enum": [
"application/json"
]
}
}
}
}
}
}
Response 400 Bad Request
Response 401 Unauthorized
Refer to the common response description: UnauthorizedError.
Response 403 Forbidden
Refer to the common response description: UnauthorizedError.
Response 404 Not Found
Response 500 Internal Server Error
Refer to the common response description: ServerError.
Schemas
STACItem
| Name | Type |
|---|---|
assets |
|
bbox |
Array<> |
links |
Array<> |
properties |
|
type |
string |
Common responses
This section describes common responses that are reused across operations.
UnauthorizedError
API Token is missing or invalid
ServerError
Internal Server Issue. Please report this to us here.
Security schemes
| Name | Type | Scheme | Description |
|---|---|---|---|
| Authorization | http | token |