Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API doc for new REST endpoint: /place/stat/date/within-place #150

Open
beets opened this issue Feb 18, 2021 · 3 comments
Open

API doc for new REST endpoint: /place/stat/date/within-place #150

beets opened this issue Feb 18, 2021 · 3 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request REST

Comments

@beets
Copy link
Contributor

beets commented Feb 18, 2021

This endpoint allows a user to retrieve dates with data available for each statistical variable specified. The set of places to query is specified by an ancestor place, and the place type of the child places to consider (similar to our places-in API). This is helpful for building an interactive app to explore our data, e.g. https://staging.datacommons.org/tools/scatter2

Endpoint: /place/stat/date/within-place (code)

Params:

  • ancestor_place
  • place_type
  • stat_vars (repeated list of stat_vars accepted)

Available as both GET and POST

Request: curl -X POST https://api.datacommons.org/place/stat/date/within-place -d '{ "ancestor_place": "geoId/06”, “place_type”: “City”, “stat_vars”: [“Count_Person”]}'
Response: {“Count_Person”: [“2017”, “2018”, ...]}

or

https://api.datacommons.org/place/stat/date/within-place?ancestor_place=geoId/06&place_type=County&stat_vars=Count_Person&stat_vars=Count_Person_Female

/cc: @shifucun

@beets
Copy link
Contributor Author

beets commented Feb 18, 2021

@beets
Copy link
Contributor Author

beets commented Feb 18, 2021

@KilimAnnejaro the scatterplot tool is an example of an app that would need this feature - we shouldn't mention it since it's not launched yet

@beets
Copy link
Contributor Author

beets commented Feb 18, 2021

@beets beets added enhancement New feature or request documentation Improvements or additions to documentation REST labels Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request REST
Projects
None yet
Development

No branches or pull requests

2 participants