sabesp-mananciais-api
sabesp-mananciais-api copied to clipboard
[Experiment] A simple scraping application to visualize data about water in São Paulo.
Sabesp Mananciais API
A simple scraping application to visualize data about water in São Paulo.
Development
Setup
-
Clone the repository
git clone https://github.com/rafaell-lycan/sabesp-mananciais-api.git
-
Install dependencies
cd sabesp-mananciais-api yarn
-
Start the dev server
yarn develop
-
You can now access it on http://localhost:3000.
Testing
Run unit tests
yarn test
Usage
Available routes
Description | Method | URL | Params |
---|---|---|---|
Get data of today | GET | / |
NULL |
Get data of a specific day | GET | /:date |
YYYY-MM-DD |
Get data of today | GET | /v2 |
NULL |
Get data of a specific day | GET | /v2/:date |
YYYY-MM-DD |
⚠️ Important ⚠️
It isn't possible get data before January 1th, 2003 or future.
Response format at /
[
{
"name": "Cantareira",
"data": [
{"key": "volume armazenado", "value": "7,2 %"},
{"key": "pluviometria do dia", "value": "0,0 mm"},
{"key": "pluviometria acumulada no mês", "value": "0,0 mm"},
{"key": "média histórica do mês", "value": "271,1 mm"} ]
},
//...
]
Response format at /v2
(Simple way to serialize JSON data)
Thank you @wcastello for the suggestion.
[
{
"name": "Cantareira",
"data": {
"volume_armazenado": "19,0 %",
"pluviometria_do_dia": "0,2 mm",
"pluviometria_acumulada_no_mes": "206,5 mm",
"media_historica_do_mes": "178,0 mm"
}
},
//...
]
Team
Sabesp API was made with love and a lot of JavaScript by these guys:
Rafaell Lycan | William Bruno |