2018 ACS1 Metadata

Hello all,

I am having trouble successfully requesting table-specific metadata for the 2018_ACS 1-Year dataset.

Apologies for the extremely general inquiry, but I cannot identify the issue. The table(s) I am attempting to pull metadata from show up in the single dataset metadata. See below for a portion of my function.

I appreciate any assistance you can provide.

dataset <- "2018_ACS1"
tabl <- "AIT3"

NHGIS_datasetdl <- function(auth_key, dataset, tabl, ) {
  file_downloads <- "./Downloads"
  
  ### Step 1: Download the metadata for each table
  ipums_url  <- paste0("https://api.ipums.org/metadata/nhgis/datasets/", dataset, "/data_tables/", tabl, "?version=v1")
  ipums_md   <- GET(ipums_url, add_headers(Authorization = auth_key))
  ipums_md   <- content(ipums_md, "parsed", simplifyDataFrame = TRUE)

Hi Brian,

Let’s see if we can help you troubleshoot this! What HTTP Status Code and response payload are getting returned from the API?

Thanks,
Fran

When I try your URL (https://api.ipums.org/metadata/nhgis/datasets/2018_ACS1/data_tables/AIT3?version=v1), I get the following response from the API:

{
    "type": "RecordNotFound",
    "status": {
        "code": 404,
        "name": "Not Found"
    },
    "detail": "Couldn't find DataTable."
}

That clue helped me realize the underlying issue - you want to use the datatable name from the dataset metadata for the datatable, not the NHGIS code. So for the table with NHGIS code AIT3, you’d want to use B01001 there instead: https://api.ipums.org/metadata/nhgis/datasets/2018_ACS1/data_tables/B01001?version=v1

Hope that helps!

Hey thank you for the quick response!

  1. 404 Not Found
  2. Not sure? Is there something specific you’d want? Apologize for my ignorance

Thank you!! Btw I think the example workflows use the NHGIS table codes, but that might be specific to the dataset referenced.

Happy to help.

I glanced through the developer docs for this part of the workflow (https://developer.ipums.org/docs/workflows/explore_metadata/nhgis/datasets/) and it looks like we are using the data table names in the examples, but if you do come across an example where we’ve mistakenly used the code instead, let us know and we’ll get that cleaned up.

Thanks!

1 Like