Hi there.
I’m using Python to make API calls to NHGIS.
I’m a rudimentary coder and now stumped with what seems to be an API syntax issue.
This works:
my_key = “xxxxxxx”
my_headers = {“Authorization”: my_key}
This one works
url = “https://api.ipums.org/metadata/nhgis/datasets?version=2”
response = requests.get(url, headers=my_headers)
However, any permutation – variable or hard coded – of calling table files gives me a 404.
dataset = “1840_cPop”
table = “NT2”
All of these get 404 error code
url = “https://api.ipums.org/metadata/nhgis/datasets/{dataset}/data_tables/{table}?version=2
…redacted to get by the blog filter limitation/datasets/{dataset}?version=2”
…redacted to get by the blog filter limitation/datasets/1840_cPop?version=2"
Any guidance on what I am doing wrong will be much appreciated.
DP