ACS Data Users Group

 View Only
  • 1.  PUMS API

    Posted 10-02-2022 01:36 PM

    Does anyone know how to download the PUMS replicate weights (all 80 of them) using the API ? When I try to list all 80 variable in the API call I get the ERROR: "error: 'get' is limited to 50 variables." Is there a way to download the 80 weights along with other variables without having to have to break everything up into groups of fewer than 50 variables ?

    Thanks Dave Dorer



  • 2.  RE: PUMS API

    Posted 10-03-2022 05:27 PM

    I haven't done it through the API directly, but if you use R you can use the the tidycensus package to make the API call / download the data. It's worked well for me.



  • 3.  RE: PUMS API

    Posted 10-03-2022 05:34 PM

    In tidycensus, we handle this limit by making repeated calls to the API and combining the results if more than 50 variables (including weights) are requested. Here's the code that does that: github.com/.../pums.R



  • 4.  RE: PUMS API

    Posted 10-03-2022 07:01 PM

    Dear Matt and Elizabith,

    I usually call the API from within my own R code. I was hoping the the API would handle the replicate weights somehow as there are 80 of them so you have to make at least 2 calls. Thanks for letting me know that tidycensus uses repeated calls. I used the multiple calls solution and it sounds like that is the only way to do it.



  • 5.  RE: PUMS API

    Posted 10-04-2022 09:22 AM

    why not download stuff from ipums.org? I understand using APIs for tables, but the rationale for straining the API to load the microdata is beyond me.



  • 6.  RE: PUMS API

    Posted 10-04-2022 10:42 AM

    Deat Stas,

    Being a research "guy" I try to get as close to the original data source as possible. When I download something via the API using R I save the object in a file so I only download once. Ipums has a lot of great stuff but as of now I am only doing cross sectional analyses so I haven't needed some of the ipums features.