waldoj / frostline

A dataset, API, and parser for USDA plant hardiness zones.
https://phzmapi.org/
MIT License
149 stars 25 forks source link

API requires passing the referrer #6

Closed harpster604 closed 8 years ago

harpster604 commented 8 years ago

Does this still work? I'm getting "too many API errors" and it doesn't do anything. I tried to manually access the API link and it seems to return a 504 gateway timeout.

waldoj commented 8 years ago

Ah, I'm glad you caught that. They've added a referrer check to their API. I've retitled this issue, and I'll modify Frostline to pass http://planthardiness.ars.usda.gov/PHZMWeb/ as the referrer.

waldoj commented 8 years ago

All set! Thanks for this, @harpster604.

webmaven commented 8 years ago

:tada:

harpster604 commented 8 years ago

So it was working fine when I tested it after the last fix, but now that I actually need to run it, I'm getting errors again.

http://planthardiness.ars.usda.gov/PHZMWeb/ZipProxy.ashx?ZipCode=00705
‽http://planthardiness.ars.usda.gov/PHZMWeb/ZipProxy.ashx?ZipCode=00610
‽http://planthardiness.ars.usda.gov/PHZMWeb/ZipProxy.ashx?ZipCode=00612
‽http://planthardiness.ars.usda.gov/PHZMWeb/ZipProxy.ashx?ZipCode=00601
‽http://planthardiness.ars.usda.gov/PHZMWeb/ZipProxy.ashx?ZipCode=00602
‽http://planthardiness.ars.usda.gov/PHZMWeb/ZipProxy.ashx?ZipCode=00603
‽http://planthardiness.ars.usda.gov/PHZMWeb/ZipProxy.ashx?ZipCode=00703
‽http://planthardiness.ars.usda.gov/PHZMWeb/ZipProxy.ashx?ZipCode=00704
‽http://planthardiness.ars.usda.gov/PHZMWeb/ZipProxy.ashx?ZipCode=07675
‽http://planthardiness.ars.usda.gov/PHZMWeb/ZipProxy.ashx?ZipCode=07677
‽Too many API errors: halting.

From what I can see it looks like they changed the api from: http://planthardiness.ars.usda.gov/PHZMWeb/ZipProxy.ashx to http://planthardiness.ars.usda.gov/PHZMWeb/secure/ZipProxy.ashx

But it still doesn't seem to be grabbing any data for me.

webmaven commented 8 years ago

@harpster604, see #7 and #8.