Identification, Images, & Information
For Insects, Spiders & Their Kin
For the United States & Canada

api.bugguide.net and Taxonomy Exports

Someday BugGuide will have a full API (application programming interface). But for now we are starting with baby steps.

I am often asked if there is a way to get a list of species from BugGuide without traversing the Taxonomy tab and doing a lot of cutting and pasting. So now we have an easy way to get this.

The following files are built daily. They reflect the current taxonomy on BugGuide.

Each file is a tab-delimited text file. It can be directly imported into Excel or another program of your choosing.

The headings on the file are:

Genus Species Family Order BugGuideID URL Common Name

Here is an example from the first two lines of Siphonaptera.txt:

Genus Species Family Order BugGuideID URL Common Name
Ctenocephalides felis Pulicidae Siphonaptera 30402 http://bugguide.net/node/view/30402 Cat Flea

You can download the files here:

https://api.bugguide.net/taxonomy/Blattodea.txt
https://api.bugguide.net/taxonomy/Coleoptera.txt
https://api.bugguide.net/taxonomy/Dermaptera.txt
https://api.bugguide.net/taxonomy/Diptera.txt
https://api.bugguide.net/taxonomy/Embiidina.txt
https://api.bugguide.net/taxonomy/Ephemeroptera.txt
https://api.bugguide.net/taxonomy/Hemiptera.txt
https://api.bugguide.net/taxonomy/Hymenoptera.txt
https://api.bugguide.net/taxonomy/Lepidoptera.txt (but see below)
https://api.bugguide.net/taxonomy/Mantodea.txt
https://api.bugguide.net/taxonomy/Mecoptera.txt
https://api.bugguide.net/taxonomy/Megaloptera.txt
https://api.bugguide.net/taxonomy/Microcoryphia.txt
https://api.bugguide.net/taxonomy/Neuroptera.txt
https://api.bugguide.net/taxonomy/Notoptera.txt
https://api.bugguide.net/taxonomy/Odonata.txt
https://api.bugguide.net/taxonomy/Orthoptera.txt
https://api.bugguide.net/taxonomy/Phasmida.txt
https://api.bugguide.net/taxonomy/Plecoptera.txt
https://api.bugguide.net/taxonomy/Protorthoptera.txt
https://api.bugguide.net/taxonomy/Psocodea.txt
https://api.bugguide.net/taxonomy/Raphidioptera.txt
https://api.bugguide.net/taxonomy/Siphonaptera.txt
https://api.bugguide.net/taxonomy/Strepsiptera.txt
https://api.bugguide.net/taxonomy/Thysanoptera.txt
https://api.bugguide.net/taxonomy/Trichoptera.txt
https://api.bugguide.net/taxonomy/Zoraptera.txt
https://api.bugguide.net/taxonomy/Zygentoma.txt

There is also an export of the Lepidoptera available that has an additional column for Hodges numbers:

https://api.bugguide.net/taxonomy/Lepidoptera_hodges.txt

Improved previewing?
One thing that would help downstreams write less scraping code (and avoid needing API code written & maintained by BugGuide) is to alter the HTML for pages to include whatever the most relevant info is on the page. Please see: https://github.com/synrg/dronefly/issues/64

With respect to the files you've provided so far ...

I've been pondering writing an extension to our Discord bot that would use your taxonomy so that people could ask the bot for a guide from BugGuide using scientific & common name search terms, much in the same way we currently support this for iNaturalist taxonomy searches. If you could please also produce a file that lists all the filenames in your export, that would help towards this goal!

502 Error
I guess these URLs are no longer valid? I get 502, invalid gateway.

 
Back up
The backend server that the actual information is retrieved from has been down for a full backup. The server is back online this morning.

 
Thanks
Thanks for the quick reply. Great timing of mine checking this out during a backup. :)

Input validation
Remember to block tabs, newlines, and other special characters from being entered into the common name field. Or escape them on output.

 
Cleaning output
Agree. The output in the above exports pass through a preg_replace('/\s+/S', $s). This takes care of tabs and newlines. If special characters appear in current data we should fix them in the source. For example, I just changed a "smart quote" apostrophe to a straight quote for Arenivaga bolliana.