mikemahoney218 / plantr

Retrieve data from the USDA PLANTS Database
https://mikemahoney218.github.io/plantr/
Other
2 stars 0 forks source link

JSON error in ptr_search #1

Open hrdawson opened 1 year ago

hrdawson commented 1 year ago

When I attempt the example of

ptr_search(common_name = "balsam fir")

I get the following error

> ptr_search(common_name = "balsam fir")
No encoding supplied: defaulting to UTF-8.
Error: lexical error: invalid char in json text.
                                       <!DOCTYPE html PUBLIC "-//W3C//
                     (right here) ------^

The same error occurs for scientific names Pseudotsuga menziesii and Acer rubrum. I'm running R v. 4.2.1 in R Studio v. 2022.02.4 on Mac OS X 10.15.7.

This is my first time using this package–I have a long list of plants to gather data from and would love to use a wrapper like this if the error can be resolved. Thank you!

mikemahoney218 commented 1 year ago

Sorry @hrdawson , it seems like the USDA Plants API has been shut off. The link in the readme redirects to a blank page at https://plants.sc.egov.usda.gov/ , the URL this package uses ( http://plants.usda.gov/api/plants/search ) is a 404, and even https://plants.usda.gov/ doesn't mention an API anymore. You might get similar data from https://plants.usda.gov/home/downloads .