sat-utils/sat-api

pagination link's url encoded twice

vincentsarago opened this issue · 1 comments

import requests

query = {"limit": 10, "query": {"eo:cloud_cover": { "eq": 18}}}
url = "https://sat-api.developmentseed.org"

headers = {
    "Content-Type": "application/json",
    "Accept-Encoding": "gzip",
    "Accept": "application/geo+json"
}
data = requests.post("https://sat-api.developmentseed.org/stac/search", json=query, headers=headers).json()

print(data["meta"])
print(data["links"][0]["href"])

> {'page': 1, 'limit': 10, 'found': 11938, 'returned': 10}
> https://sat-api.developmentseed.org/stac/search?query=%5Bobject%20Object%5D&page=2&limit=10

I forgot, but this has actually already been fixed in develop.