Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API for USDA plants database? #7

Closed
sckott opened this issue Oct 18, 2013 · 100 comments
Closed

API for USDA plants database? #7

sckott opened this issue Oct 18, 2013 · 100 comments

Comments

@sckott
Copy link

sckott commented Oct 18, 2013

Any plans to expose an API for the USDA plants database? There is a lot of information in their on characteristics of different plant species that would be nice to access via a REST API.

@nekhbet
Copy link

nekhbet commented Jul 10, 2014

I'm also interested in this so +1

@ccwasden
Copy link

+1

@jrherr
Copy link

jrherr commented Jul 11, 2014

As a former (6 year) employee of the USDA now in academia, I would highly support and endorse an API for this database. If there is anything I can do to move this along, please let me know.

@nicshackle
Copy link

+1

@webmaven
Copy link

👍 from me as well.

@DWiechert
Copy link

+1 - I would like to have a plants API as well.

@webmaven
Copy link

webmaven commented Sep 2, 2015

@konklone, any info as to whether this is in the works?

@konklone
Copy link
Contributor

konklone commented Sep 2, 2015

I have no idea. =) CC-ing @thisisparker.

@sckott
Copy link
Author

sckott commented Sep 2, 2015

Seems we can give up on this now, 2 years later :(

@jrherr
Copy link

jrherr commented Sep 2, 2015

Unfortunately, I agree with @sckott here, we should give up hope that this is going to happen. :(

@sckott sckott closed this as completed Sep 6, 2015
@bbrotsos
Copy link

bbrotsos commented Sep 8, 2015

Can you leave this issue open?

@sckott sckott reopened this Sep 8, 2015
@sckott
Copy link
Author

sckott commented Sep 8, 2015

@bbrotsos does this mean this is in the works?

@sckott
Copy link
Author

sckott commented Jan 27, 2016

@bbrotsos is the api in the works?

@abargmann
Copy link

👍 this would be cool

@annetters
Copy link

Having access to a USDA database of plants would be really helpful in building applications that target gardeners and plant enthusiasts. Currently, many application developers are creating their own databases of plants with common information, overlapping one another.

@dlebauer
Copy link

In the meantime you can get most fields, all records and more at http://betydb.org/species.json (or .csv or .xml). Still this is not the canonical version and probably not updated since 2010

@dlebauer
Copy link

correction to my previous post. Apparently we reduced the amount of data returned by the api call above.

However, (@sckott) given that the USDA Plants database is "free for any use" (http://plants.usda.gov/java/intellectualPlants) and here is a copy from 2011: https://uofi.box.com/s/erpkt05msepkld5zitij7elvzrh4bpi8 that I think has all of the fields. Wouldn't it be pretty easy (for someone like you) to host and configure an API somewhere (at least in the meantime)?

@sckott
Copy link
Author

sckott commented Feb 23, 2016

@dlebauer cool, so the whole thing is only 34 MB, can that be right? about 50K rows

@dlebauer
Copy link

That's what I have. I know there are also photos on the website but this is the bulk of the info.

I forgot to export column names in the version above. I'll do that and remove some rows that we inserted to track crop hybrids and update later today.

@sckott
Copy link
Author

sckott commented Feb 23, 2016

thanks

@dlebauer
Copy link

OK. Here it is on Box there is a csv (32MB) and RData file (2.3MB): https://uofi.box.com/s/pbr11886smc33hfnqw239m2bivavzwwp

I've removed most of the rows that we added and returned column names to USDA style CamelCase. I kept the field 'betydb.species.id' as foreign key to BETYdb; otherwise this should be pretty close to the original ... I also kept the 'created_at' and 'updated_at' fields - created_at is probably the date of import and if updated_at is the same there is probably no difference. Empty strings and NAs can be treated as missing (e.g. NULL though some prefer not to use that).

Code used to (mostly) revert betydb.species to usda.plants is here: https://gist.github.com/dlebauer/15b588bf334334a34c31

@sckott
Copy link
Author

sckott commented Feb 24, 2016

thanks!

@dlebauer
Copy link

@sckott I did some advanced searching and found almost 100k records; I added it to the same Box folder as above (https://uofi.box.com/s/pbr11886smc33hfnqw239m2bivavzwwp). The file is called usda_plants_20160223.csv Unlike the other files, this is direct from the source. If you want to normalize it, there are actually only ~2000 records with detailed characteristics (i.e. columns to the right of "Active Growth Period"). Also, this one doesn't include information on wetland status, since USDA says this information is kept up to date on the National Wetland Plant List (http://rsgisias.crrel.usace.army.mil/NWPL/).

Good Luck!

@sckott
Copy link
Author

sckott commented Feb 24, 2016

Nice, thanks.

@sckott
Copy link
Author

sckott commented Feb 24, 2016

API at https://github.com/sckott/usdaplantsapi

@sckott
Copy link
Author

sckott commented Feb 29, 2016

API up at https://plantsdb.xyz

@dlebauer
Copy link

How does it work?
On Mon, Feb 29, 2016 at 1:18 PM Scott Chamberlain notifications@github.com
wrote:

API up at https://plantsdb.xyz


Reply to this email directly or view it on GitHub
#7 (comment).

@jeffdc
Copy link

jeffdc commented Aug 29, 2021

For the project that I am working on, I had to write an importer for the CSVs. It is not meant to be standalone useful but you can see the code here: https://github.com/jeffdc/gallformers/tree/main/usda_plants It is a simple Rust program that loads the CSVs (I downloaded them all from here) parses them and then loads the data into a simple Sqlite database. It was written specifically for my needs so it has some other stuff in there that is specific to my project, but maybe it will be helpful to someone else.

@brickman1444
Copy link

For the current site, it looks like there are some public endpoints. When running a search I was able to see a request like this in the Inspect window in Chrome:

curl "https://plantsservices.sc.egov.usda.gov/api/PlantSearch" -H "Content-Type: application/json" --data-raw ^"^{ ^^"Text^^": ^^"Ratibida columnifera^^", ^^"Field^^": ^^"Scientific Name^^",^}^" ^ --compressed

The results from that include the symbol (RACO3) and id (39375) of the plant.

And then looking at an a plant profile (example: https://plants.usda.gov/home/plantProfile?symbol=RACO3) I can see some requests like this:

https://plantsservices.sc.egov.usda.gov/api/PlantProfile?symbol=RACO3
https://plantsservices.sc.egov.usda.gov/api/PlantDocumentation/39375?orderBy=DataSourceString&offset=-1

So you could use those to perform an operation like: Search for a name -> Return the profile information for that plant. It looks pretty difficult to use and probably fragile since it's not a publicized API but it's usable.

@chadchandler2423
Copy link

chadchandler2423 commented Sep 25, 2021 via email

@chadchandler2423
Copy link

chadchandler2423 commented Sep 25, 2021 via email

@ranchinggames
Copy link

ranchinggames commented Nov 16, 2021

@chadchandler2423 Any updates on an available API that allows the download of plant data similar to https://plants.usda.gov/csvdownload?plantLst=plantCompleteList

I am even curious if you would entertain having an API that provides an icon/thumbnail to represent the plant?

@HandcartCactus
Copy link

@ranchinggames I emailed the point of contact at the USDA site, and they told me that the UofI link in the thread above from a few years ago is the same as the database they have now.

https://m.box.com/shared_item/https%3A%2F%2Fuofi.box.com%2Fs%2Fpbr11886smc33hfnqw239m2bivavzwwp

@ranchinggames
Copy link

@Ejjaffe thanks for the follow up and the link! If it hasn't change in such a long time. I will use the version.

@varelycode
Copy link

varelycode commented Nov 21, 2021

It seems in the plants search you could get list of plants by the county. The CSV files uploaded here didnt seem to show a county associated with a plant. Anyone know were I can get county info for each plant

@dlebauer
Copy link

It seems in the plants search you could get list of plants by the county. The CSV files uploaded here didnt seem to show a county associated with a plant. Anyone know were I can get county info for each plant

I don't know if USDA Plants provides that but you might try
https://docs.ropensci.org/spocc/

@HandcartCactus
Copy link

County information for the plants is limited. This is a difficult thing to keep track of. You may have better luck with iNaturalist, which uses citizen scientists to record observations all over the world. This is INat's Developers page. There are lots of resources there, including their export tool (login required), public APIs, and various datasets.

Just going to throw this out there: I reached out to plants-ftc@usda.gov and they did respond within a few days, so if you have questions, sometimes they can answer them directly.

@chadchandler2423
Copy link

chadchandler2423 commented Dec 14, 2021 via email

@forrestblade
Copy link

Welcome to 2022, good job on getting through that last year, that was crazy. Any update on a public facing API with information about plants in our Homeland?

@drewlustro
Copy link

Welcome to 2023!

@Avasond
Copy link

Avasond commented Mar 24, 2023

I have a little Postman collection that queries the DB if anyone wants to use it.

@chadchandler2423
Copy link

chadchandler2423 commented Mar 24, 2023 via email

@Avasond
Copy link

Avasond commented Mar 24, 2023

It's not very robust (at all) but it works if you just want to pull the JSON for a species. It could definitely be expanded but I don't wanna manually enter all the taxon filters.

@chadchandler2423
Copy link

chadchandler2423 commented Mar 24, 2023 via email

@sciaschi
Copy link

sciaschi commented Apr 17, 2023

do you think itd be an issue if i ran a query on each plant to get the characteristics? itll take forever but i could get a csv that way of all the characteristics for available plants. I dont wanna get flagged for running 2k queries just to store it

@chadchandler2423
Copy link

chadchandler2423 commented Apr 17, 2023 via email

@katiechurchwell
Copy link

@sciaschi If you do generate that csv, would you share please? :)

@sciaschi
Copy link

@katiechurchwell totally! im trying to get it formatted nicely but just a heads up, it'll be info overload O.o

@sciaschi
Copy link

sciaschi commented Apr 19, 2023

Alright heres the CSV i generated from the website data directly. Im unsure of the changes between the m.box link and this one.

New: https://1drv.ms/u/s!AlSMJqLB0fp2i_R_2xJFoVa1wKdPVw?e=GE7FZ8

Old?: https://m.box.com/shared_item/https%3A%2F%2Fuofi.box.com%2Fs%2Fpbr11886smc33hfnqw239m2bivavzwwp

Mine is only generated using the characteristic search plants which came out to around 2175 plants. Some still dont have characteristics but thats on their data. I included the json in the event someone wants to use it :)

Edit 8/1/2023: Updated "New" link with corrected data

@katiechurchwell
Copy link

@sciaschi thank you!!

jkropko added a commit to code-for-charlottesville/piedmont-native-plants-db that referenced this issue Jun 21, 2023
@kdnune
Copy link

kdnune commented Jul 30, 2023

@sciaschi thanks for providing this, but I don't see roughly 2200 distinct species. It looks like the data repeats Abelia grandiflora, Abies amabilis, Abies balsamea, Abies concolor, Abies fraseri, Abies grandis, Abies lasiocarpa, Abies magnifica, Abies magnifica, Abies procera, Acacia cyclops, Acacia koa, Acacia koaia, Acacia longifolia, Acacia melanoxylon, Acalypha virginica, Acer circinatum, Acer floridanum, Acer ginnala, Acer glabrum, Acer glabrum, Acer grandidentatum, Acer macrophyllum, Acer negundo, Acer nigrum. Am I missing something? Thanks again.

@sciaschi
Copy link

@kdnune I'm not too sure 🤔 I didn't really change the data once it was converted to the csv so any data that came through is basically raw data i converted to a csv. I took a look though it quick but didn't see any duplicates 🤔 would you be able to point out where the duplicates of some of those are? Like the row numbers would work because if there are, I dont mind updating it to make it more accurate.

@kdnune
Copy link

kdnune commented Jul 31, 2023

@sciaschi I ran a value_counts on the 'Id' field and I see only about 25 values repeated over and over again for 2175 rows. The value counts for the 'Id' field are:
42690 87
76682 87
92814 87
92813 87
92794 87
92778 87
92774 87
92772 87
92759 87
92756 87
75335 87
76690 87
76675 87
15308 87
76670 87
76633 87
15346 87
15342 87
15340 87
15328 87
15321 87
15319 87
15316 87
15309 87
92832 87

Are we looking at different files? Thanks for all your help.

@sciaschi
Copy link

sciaschi commented Aug 1, 2023

@kdnune ya know, this is why i should really double check my work XD i had a version of my program that didnt actually increase the offset for the api to get each page instead of just getting the first page of results. I uploaded a new version with the json and csv. Sorry about that! XD

https://1drv.ms/u/s!AlSMJqLB0fp2i_R_2xJFoVa1wKdPVw?e=GE7FZ8

@nacairns1
Copy link

Hey everyone, I launched an api to programmatically expose the USDA PLANTS data at plantapi.xyz. Would love any feedback on the project and any additional desired features as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests