HTTP protocol: there's a url that specifies the location + there can then be query parameters, which are designated by a ? + anything that follows
E.g. UC Census Bureau (not a very nicely-documented API...)
api.census.gov/data/2021/pep/population?get=DENSITY_2021,POP_2021,NAME,STATE&for=region:*&key=YOUR_KEY
api.census.gov/data/2021/pep/population: API endpoint, which correesponds to a resource that a server knows how to provide back; in this case, that resource is the 2021 pop estimate
?get=DENSITY_2021,POP_2021,NAME,STATE&for=region:*&key=YOUR_KEY: this is the query string that contains all of the parameters (variables) that are being passed in this example API call that affect the output of the request
get, for, key: all accepted query string parameters
get accepts a list of strings, for accepts a string, and key is your API key
Needed a place to job down random things; need to organize better soom.
{httr2}
packageHTTP protocol: there's a url that specifies the location + there can then be query parameters, which are designated by a
?
+ anything that followsE.g. UC Census Bureau (not a very nicely-documented API...)
api.census.gov/data/2021/pep/population?get=DENSITY_2021,POP_2021,NAME,STATE&for=region:*&key=YOUR_KEY
get
,for
,key
: all accepted query string parameterskey
is your API key