Skip to content

Subscription Generic badge Generic badge

Description

The Subscription endpoint enables users to access near real-time data from their subscription packages. This API uses Server Sent Events, so you'll only need to connect once to recieve updates into the future.

Please note that this endpoint does not stream imagery, only metadata (STAC Item) which you can then access the assets you require for your application.

URL

https://datasphere.astrodynamic.space/subscription/v1/?package={package name}
Authentication Required

Generate API Token.

Header Value
Authorization Token {Your Token}

Response

Content Type
text/event-stream; charset=utf-8
Parameter Type Description
id string (utf-8) Message id
data string (utf-8) Near real-time updates STAC Items (JSON-encoded UTF-8 string) from your subscription.
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

Basic Example

import requests
import json

uri = "wss://datasphere.astrodynamic.space/subscription/v1/?package={package name}"

with requests.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())

OpenAPI Docs

Subscription 1.0.0

Server Sent Event API to receive near-realtime updates from subscription packages. Please note that this endpoint does not stream imagery, only metadata (STAC Item) which you can then access the assets you require for your application.


Servers

Description URL
Data Sphere https://datasphere.astrodynamic.space

Endpoints


GET /subscription/v1/?package={package name}

Server Sent Event endpoint to get near-realtime updates from subscription packages.

Input parameters

Parameter In Type Default Nullable Description
Authorization header string N/A No
package name query string No Name of your subcription package

Response 200 OK

{
    "id": "string",
    "data": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "description": "A server-sent event message containing STAC Item updates from user's subscription package.",
    "type": "object",
    "required": [
        "data"
    ],
    "properties": {
        "id": {
            "type": "string",
            "format": "UTF-8",
            "description": "Message id"
        },
        "data": {
            "type": "string",
            "format": "UTF-8",
            "description": "UTF-8 encoded STAC Item"
        }
    }
}

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

subscription

Name Type
data string(UTF-8)
id string(UTF-8)

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