Using SMEAR API
Last modified by Pasi Kolari on 2024/08/25 19:33
SMEAR database can be accessed from anywhere using the API. Here's some examples for constructing API calls.
for downloading and parsing data into numeric matrix or table form
for retrieving data as Pandas data frame
(updated 31.8.2021 to employ httr library instead of RCurl)
Matlab, Python and R
for downloading short pieces of data in loop using the functions above.If picking up table and column names or metadata of variables in GUI feels tedious, API provides convenient ways to search from variable metadata.
The examples below retrieve metadata in csv format, json and tsv are also available.
- One variable, need to know variable name/column and table:
https://smear-backend.2.rahtiapp.fi/search/variable/csv?tablevariable=HYY_META.Glob
- All variables in table HYY_META:
https://smear-backend.2.rahtiapp.fi/search/variable/csv?table=HYY_META
- All variables with "global" in their description:
https://smear-backend.2.rahtiapp.fi/search/variable/csv?description=global
- All variables from Värriö station:
https://smear-backend.2.rahtiapp.fi/search/variable/csv?station=varrio