your API call URL doesn't work. This one will give you PCI by ZCTA: https://api.census.gov/data/2019/acs/acs5?get=NAME,B19301_001E&for=zip%20code%20tabulation%20area:*
For top 10% within state, you'll need to do some post processing
As Jonathan Schroeder said they are no longer nested in states. They stopped being nested in states in 2020. It may not help you since it's in Python, but the censusdis package can do all of this for you, or will be able to as of the next release. Take…
Do you need data for the whole country or just a subset? I have found it really difficult to work with ZCTAs on the new site because they don't nest within other geographies (so no filtering by state) and there are too many of them to easily get the full…