hi,
I am new to the IPUMS community, and I expect to actively use the IPUMS API.
I am using R to get a data call using the IPUMS API key, but I am getting an error message that reads like this “Error: Your API call has errors. The API message returned is HTTP Status 404 ? Not Foundbody {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}
HTTP Status 404 ? Not Found
.”
I am not completely sure what is wrong. See script below
library(ipumsr)
library(mapview)
set_ipums_api_key(“I inserted the key code here”, save=TRUE)
dc_pums_2021 ← get_pums(variables =c(“SEX”,“AGEP”,“HHT”,“MV”),
state=“DC”, survey = “ACS5”,
year=2021, recode = TRUE)
It looks like the issue is that you are requesting variable names that do not exist in IPUMS USA. These appear to be original ACS variable names from the PUMS. IPUMS renames all variables. For example, in the original PUMS file, the age variable is AGEP, but in IPUMS USA, it is AGE. You can browse and find variables in the IPUMS USA extract system.
@Jose_Funes another issue is that get_pums()
is a function from the tidycensus package, not ipumsr. I would recommend reading through this ipumsr vignette if you want to request IPUMS USA data via the IPUMS API.
is there a way to get the original ACS variable name from the data extract ?
The source variables in IPUMS USA often include the original ACS variable name. For example, looking at EMPSTAT, the corresponding source variable for the 2022 ACS is US2022A_ESR. The variable ESR is the original ACS variable that reports labor force status. However, we do not have a systematic way for data users to identify the original names. For now, you would need to use the IPUMS websites; source variables associated with harmonized IPUMS are listed under the “Source Variables” tab and you can add source variables to your extract by clicking “add to cart” on the source variable’s page.