User facing API for Missing Maps statistics.
You could run
docker-compose up
or follow the steps listed here.
-
Clone local copies
git clone git@github.com:AmericanRedCross/osm-stats-api.git
git clone git@github.com:AmericanRedCross/osm-stats-workers.git
-
Get the Postgres server running on your machine
pg_ctl -D /usr/local/var/postgres start
-
Add env variables
export OVERPASS_URL=<overpass url>:6080
export DATABASE_URL=postgresql:///osm_stats_2
-
npm i pgexplode
-
Run
make db/all
-
Connect to
psql -d osm_stats_2
-
Fetch value from http://overpass-api.de/api/augmented_diff_status
-
From psql run
update augmented_diff_status set id = <value from earlier step> - 10
-
Fetch value from https://planet.osm.org/replication/changesets/state.yaml
-
From psql run
update changesets_status set id = <value from earlier step> - 10
-
Switch to osm-stats-workers directory and run
`npm run housekeeping`
`npm run update-badges`
`npm install`
`npm start`
- Get back to
osm-stats-api
and runnpm start
. This should give you the local api link
- Redis
- PostgreSQL (referenced via
DATABASE_URL
)
- /stats/{hashtag?}
- /users
- /users/{user_id#}
- /hashtags
- /group-summaries/{hashtag-name-1, hashtag-name-2, ...}
- /top-users/{hashtag-name}
- /hashtags/{hashtag-name}/map
- /countries
- /countries/{country-code}
- /countries/{country-code}/hashtags
- /countries/{country-code}/users
All endpoints and additional documentation can be found in the osm-stats API documentation.