API-alpha for Bug Guide

Explore the data-set of 40511 insects!

Based on bugguide.net’s multiple .txt sets, I created an API to deliver insects’ data in JSON format. At present, the API only delivers the common name, genus, species, family, order, bug_guide_id, and bugguide.net URL information.

API Endpoint

https://bugs.verfasor.com/api

Documentation

Data can be parsed as JSON. Access to the bugs.deadauthor.org doesn’t require a token-based authentication. Kindly avoid sending too many requests. Consider donating if you plan to actively use the API.

Examples

Query TypeURL
General queryGET https://bugs.verfasor.com/api?q=Soldier%20Beetle
Query a Common NameGET https://bugs.verfasor.com/api?q=Soldier%20Beetle
Query a GenusGET https://bugs.verfasor.com/api?Genus=Chauliognathus
Query SpeciesGET https://bugs.verfasor.com/api?Species=pensylvanicus
Query a FamilyGET https://bugs.verfasor.com/api?Family=Cantharidae
Query an OrderGET https://bugs.verfasor.com/api?Order=Coleoptera
Query a Bug Guide IDGET https://bugs.verfasor.com/api?BugGuideID=438
Query combination and filterGET https://bugs.verfasor.com/api?Order=Coleoptera&q=beetle

API Usage Example (Python)

import requests
import json
import random

seed = random.randint(0, 40510)
print(seed)

# API
link = 'https://bugs.verfasor.com/api'

# Request data
data = requests.get(link).text

# Print stuff you like
number = json.loads(data)
print("%s" % (number[seed]["Number"]))

genus = json.loads(data)
print("%s" % (genus[seed]["Genus"]))

species = json.loads(data)
print("%s" % (species[seed]["Species"]))

family = json.loads(data)
print("%s" % (family[seed]["Family"]))

order = json.loads(data)
print("%s" % (order[seed]["Order"]))

bugguideid = json.loads(data)
print("%s" % (bugguideid[seed]["BugGuideID"]))

url = json.loads(data)
print("%s" % (url[seed]["URL"]))

commonname = json.loads(data)
print("%s" % (commonname [seed]["CommonName"]))

Alpha disclaimer

The Insects JSON REST API is actually in the alpha stage, which implies that “bugs” and issues may still remain undiscovered until this phase of testing is complete. The alpha stage also means that the data may be corrupted, is not 100% validated or complete, and is subject to change. Finally, services may have downtime and the API schemas and calls are subject to change

Written by MighilMighil is an indie musician and tinkerer with diverse work experience in technology and writing. He has had the privilege of serving in various capacities, encompassing generalist and specialist roles. He is currently based in Chengdu.

Newsletter

Opt-in to receive long-form essays in your inbox. Unsubscribe anytime. Follow me on 𝕏 if you like.

Powered by DigitalOcean, BunnyCDN, WordPress.