Skip to content
getgeolens.com

Stac Asset Sizes

POST
/services/stac/asset-sizes
curl --request POST \
--url https://example.com/services/stac/asset-sizes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "url": "example", "assets": [ { "id": "example", "href": "example" } ], "auth": { "method": "bearer", "token": "example", "username": "example", "password": "example", "header_name": "example", "header_value": "example" } }'

Look up the size of data assets whose item publishes no file:size.

Asks each asset’s server for its length (HEAD, then a one-byte range request). A size the server does not report comes back as null.

Media type application/json
StacAssetSizesRequest
object
url
required
Url

STAC API root URL the assets were found in.

string
>= 1 characters <= 2048 characters
assets
required
Assets

Assets to measure (max 50 per request).

Array<object>
>= 1 items <= 50 items
StacAssetSizeTarget
object
id
required
Id

STAC item ID the asset belongs to.

string
<= 2048 characters
href
required
Href

URL of the item’s data asset.

string
<= 4096 characters
auth
Any of:
ServiceAuthRequest

How one request authenticates to the remote service it names.

object
method
required
Method

How the credential is presented to the remote service. Omit the whole auth object for a public service.

string
Allowed values: bearer basic header
token
Any of:
string
<= 1000 characters
username
Any of:
string
<= 255 characters
password
Any of:
string
<= 1000 characters
header_name
Any of:
string
<= 255 characters
header_value
Any of:
string
<= 1000 characters

Successful Response

Media type application/json
StacAssetSizesResponse
object
sizes
required
Sizes

One entry per requested asset.

Array<object>
StacAssetSize
object
id
required
Id

STAC item ID.

string
size_bytes
Any of:
integer
Example generated
{
"sizes": [
{
"id": "example",
"size_bytes": 1
}
]
}

Bad request — invalid payload

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Unauthorized — missing or invalid credentials

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Forbidden — caller lacks write access

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Not found

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Conflict — resource state prevents the operation

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Validation error

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Too many requests — retry after the advertised interval

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}
Retry-After
integer

Seconds until the request may be retried

Internal server error

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Service unavailable — the database could not serve the request

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Gateway timeout — an upstream address check ran out of time

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}