Retrieve station
POST https://api.sinay.ai/metocean/api/v1/stations?dryRun=false
The endpoint allows you to retrieve historical weather data
Request
To retrieve data, you must define the position of the stations, the time interval and the model type
Stations position
There are three ways to define an area
- Around a position, from a center (longitude, latitude) and a radius, we will find and return data for stations which are in a circle around the coordinates (radius in km)
- From a station name, we will return data for this station name, and an error if the station name does not exist
- From a GeoJSON, we will find and return all stations found in the GeoJSON area, Only Geometry objects are allowed (not Feature and FeatureCollection)
Time interval
You must define the time interval for which you want to retrieve data. As our data are separated in calendar month, you can only define the year and the month for start and end time. The accepted format is yyyy-mm, for example 2022-01.
Model type
You must select the model type. You can retrieve them using the retrieve models endpoint.
Dry run
To avoid to be charged for something you don't want, you can test the request without any charge, you will be able to see the cost of your request and the results, but you won't have access to the links to download the data. A query parameter is present to activate the dry run.
Response
Data
You will find a list of stations we found for your request.
For each station, you will find the list of retrieved data with associated metadata.
Api units
An header named x-api-units will be added in each answer to tell you how many units the request cost you. If the request is done in dry run, you won't be charge, but you will be able to see how many it would cost you
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
dryRun | boolean | Useful to test the request before doing it really. If dryrun is activated, files won't be present in the answer, and the call won't be charged |
Request Body
{"area"=>{"geoJson"=>{"type"=>"Polygon", "coordinates"=>[[[35.5078125, -55.77657301866769], [36.2109375, -65.5129625532949], [65.0390625, -64.92354174306496], [64.6875, -55.17886766328199], [52.03125, -50.95842672335992], [35.5078125, -55.77657301866769]]]}}, "time"=>{"start"=>"2021-06", "end"=>"2021-08"}, "model"=>"Global"}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string |
RESPONSES
status: OK
{"stations":[{"stationName":"E06500S645","referencesMatrixFile":"https://2222222-2222222-2222222-2222222.com","longitude":25,"latitude":10.5,"data":[{"time":"2020-01","gridName":"Global 30min","modelVersion":"v6.07","companyName":"Aktis Hydraulics","link":"https://1111111-1111111-1111111-1111111.com","linkExpirationTime":"2022-01-01T10:00:00.000Z"},{"time":"2020-02","gridName":"Global 30min","modelVersion":"v6.07","companyName":"Aktis Hydraulics","link":"https://2222222-2222222-2222222-2222222.com","linkExpirationTime":"2022-01-01T10:00:00.000Z"}]},{"stationName":"E06500S645","referencesMatrixFile":"https://2222222-2222222-2222222-2222222.com","longitude":25,"latitude":10.5,"data":[{"time":"2020-01","gridName":"Global 30min","modelVersion":"v6.07","companyName":"Aktis Hydraulics","link":"https://1111111-1111111-1111111-1111111.com","linkExpirationTime":"2022-01-01T10:00:00.000Z"},{"time":"2020-02","gridName":"Global 30min","modelVersion":"v6.07","companyName":"Aktis Hydraulics","link":"https://2222222-2222222-2222222-2222222.com","linkExpirationTime":"2022-01-01T10:00:00.000Z"}]}]}