Skip to content

Commit

Permalink
Transfer API to RapidAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
clampr committed Jun 23, 2021
1 parent e78df8b commit ae385a9
Show file tree
Hide file tree
Showing 19 changed files with 761 additions and 870 deletions.
32 changes: 11 additions & 21 deletions src/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,6 @@ module.exports = {
title: 'Overview',
path: 'stations/'
},
{
title: 'Finding Stations',
path: 'stations/search'
},
{
title: 'Nearby Stations',
path: 'stations/nearby'
Expand All @@ -418,9 +414,13 @@ module.exports = {
title: 'Daily Data',
path: 'stations/daily'
},
{
title: 'Monthly Data',
path: 'stations/monthly'
},
{
title: 'Climate Normals',
path: 'stations/climate'
path: 'stations/normals'
}
]
},
Expand All @@ -441,28 +441,18 @@ module.exports = {
path: 'point/daily'
},
{
title: 'Climate Normals',
path: 'point/climate'
}
]
},
{
title: 'Wrapper',
collapsable: false,
children: [
{
title: 'JavaScript',
path: 'wrapper/javascript'
title: 'Monthly Data',
path: 'point/monthly'
},
{
title: 'PHP',
path: 'https://gitlab.com/dweipert.de/meteostat'
title: 'Climate Normals',
path: 'point/normals'
}
]
},
{
title: 'Get A Key',
path: 'https://auth.meteostat.net/'
title: 'Playground',
path: 'https://rapidapi.com/meteostat/api/meteostat/'
}
]
}
Expand Down
29 changes: 15 additions & 14 deletions src/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,42 @@

The Meteostat JSON API provides simple access to a large archive of historical weather and climate data. The records are queried by weather station or geo location and can be filtered by specifying a date range and other optional parameters.

::: tip Donation
Help Meteostat provide free weather and climate data by making a [donation](/contributing.html#donations).
:::
Meteostat uses [RapidAPI](https://rapidapi.com/meteostat/api/meteostat/), an API marketplace which makes it easy for developers to use thousands of APIs through a common platform.

The API is available via this URL:
This is the base URL for all endpoints:

```
https://api.meteostat.net
https://meteostat.p.rapidapi.com
```

Access to the API requires users to send their API key along with every request. All API endpoints return a JSON object that contains two properties: `meta` and `data`. The `meta` object provides general information about the data output and debugging information. For instance, the `source` string which holds the names of the organizations which provided the raw data. The `data` property is either an object or an array that contains the actual data output.
Access to the API requires users to send their RapidAPI key along with every request. All API endpoints return a JSON object that contains two properties: `meta` and `data`. The `meta` object provides general information about the data output and debugging information. The `data` property is either an object or an array that contains the actual data output.

All API endpoints are accessible using HTTP Get requests. For debugging, please utilize the HTTP status code of the response.

## API Key
## Sign Up

Please submit this [**form**](https://auth.meteostat.net/) to apply for an API key.
Please sign up on [RapidAPI](https://rapidapi.com/signup) to get an API key. Before you can call the Meteostat JSON API, you'll need to subscribe to one of [our plans](https://rapidapi.com/meteostat/api/meteostat/pricing). But don't worry - you'll get 500 monthly calls for free.

## Quick Start

Once you have your API key, head over to your terminal, replace the `{key}` parameter with your personal API key and execute the following command:

```sh
curl --header "x-api-key: {key}" "https://api.meteostat.net/v2/stations/meta?id=10637"
curl --request GET \
--url 'https://meteostat.p.rapidapi.com/stations/meta?id=10637' \
--header 'x-rapidapi-host: meteostat.p.rapidapi.com' \
--header 'x-rapidapi-key: {key}'
```

You should see meta information for the weather station _Frankfurt Airport_ in JSON format.

## Quota
## Plans & Quota

Free access to the Meteostat API is limited to 2,000 requests per day and no more than two requests per second. Once this limit is reached, all of your requests will result in HTTP 429, too many requests, until your quota is cleared.
Meteostat uses a freemium model for its API. We offer a free plan with a hard limit of 500 requests per month. If you need a higher quota, please choose any of our [paid plans](https://rapidapi.com/meteostat/api/meteostat/pricing).

## Authentication

When retrieving data from Meteostat API endpoints make sure to send the `x-api-key` header along with every request. You cannot use the `key` URL parameter to authenticate API calls as in version 1.
When retrieving data from Meteostat API endpoints make sure to send the `X-RapidAPI-Key` header along with every request. RapidAPI also supports passing the API Key via query parameter. You can do this by including the `rapidapi-key` parameter in your request.

## Status Codes

Expand All @@ -45,8 +46,8 @@ All Meteostat API endpoints return one of the following status codes. You can ut
| **Code** | **Description** |
|:---------|:-------------------------------------------------------------|
| 200 | _Success_: Alls is fine |
| 400 | _Bad Request_: Please check the request parameters |
| 401 | _Unauthorized_: Make sure to send a valid `x-api-key` header |
| 400 | _Bad Request_: Please check the query parameters |
| 401 | _Unauthorized_: Make sure to send a valid RapidAPI key |
| 403 | _Forbidden_: You're not allowed to access this endpoint |
| 404 | _Not Found_: This endpoint doesn't exist |
| 429 | _Too Many Requests_: You've exceeded the quota |
Expand Down
20 changes: 2 additions & 18 deletions src/api/point/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,10 @@ While weather stations provide data that was measured at a specific location, po

## Remarks

Point data is currently considered an **experimental feature**. The way data is being interpolated is still subject to changes. Moreover, point data **only returns data if there is at least one nearby weather station** that reported observations in the desired period. The model output is by no means a substitute for actual observations.

We encourage API users to give the new feature a try. Please get in touch with Meteostat for feedback and suggestions.
Point data **only returns data if there is at least one nearby weather station** that reported observations in the desired period. The model's quality is varying based on the number and proximity of nearby weather stations.

## Data Model

Point data provides more complete time series, as observations of multiple stations are joined together. The data output is being interpolated based on the geographical distance between the different weather stations and the reference point of the query. Additionally, Meteostat adjusts measurements based on environmental circumstances and differences in altitude.

Meteostat projects the existing observations which are provided by weather stations around the world to the location specified in the request. Long-term climate averages are based on the incredible [WorldClim](https://worldclim.org/) project. For more precise model output, please provide the elevation of your location using the `alt` parameter.

## Endpoints

Meteostat provides three different endpoints for point data:

* [Hourly Data](hourly.md)
* [Daily Data](daily.md)
* [Climate Normals](climate.md)

## Vision

The use cases for historical weather data are diverse. While actual observations of professional weather stations are crucial for science and research, model data provides a better coverage across the globe. Point data is an addition to the thousands of weather stations which are available through Meteostat.

With a growing community of developers and contributors who are using and building Meteostat, we will be able to provide even better model output in the future. We are visioning a machine learning based approach for point data which allows our model to improve over time.
Meteostat projects the existing observations which are provided by weather stations around the world to the location specified in the request. For more precise model output, please provide the elevation of your location using the `alt` parameter.
181 changes: 0 additions & 181 deletions src/api/point/climate.md

This file was deleted.

Loading

0 comments on commit ae385a9

Please sign in to comment.