AntWeb API

Version 2

This is an attempt to make the antweb data available to the public in an accessible format.

AntWeb is the world’s largest online database of images, specimen records, and natural history information on ants. It is community driven and open to contribution from anyone with specimen records, natural history comments, or images.

NOTE: While this api is meant to be a firehose of sorts, there is a timeout set to prevent encumbering the server. Large requests may not be fulfilled. Using limits and offsets is encouraged.

Available Arguments

There are four ways to use the api. You can query for a specific supset of specimen, you can query for a list of distinct names for a taxonomic rank, you can query for specimen near a coordinate point and you can query for images recently added to the antweb database.

Specific Subset

Subfamily Return only specimens of a specific subfamily.
Genus Return only specimens of a specific genus.
Species Return only specimens of a specific species.
Catalog Number The unique identifier of a particular specimen on Antweb (?catalognumber=inb0003695883)
Habitat This uses a wildcard so a query for ?habitat=sand will return any habitat containing the word sand (e.g. sandstone)
Country This uses a wildcard so a query for ?country=land will return any country containing the word land (e.g. England, Ireland etc)
Type (e.g. holotype), this is a wildcard
Bbox This is a bounded box of decimal coordinates in the format ?bbox=x1,y1,x2,y2
Min Date Query for specimen identified on or after a single date (?min_date=yyyy-mm-dd)
Max Date Query for specimen identified on or before a single date (?max_date=yyyy-mm-dd)
Min Elevation This is measured in meters. Query on specimen found at or above a specific elevation (?min_elevation=1200)
Max Elevation This is measured in meters. Query on specimen found at or below a specific elevation (?max_elevation=1200)
Georeferenced This is a boolean argument to filter for only geo referenced specimen (?georeferenced=true)
Limit Limit the number of specimen returned on large requests (?limit=100)
Offset Used to paginate large requests when paired with the limit argument (this would return records 301-400: ?limit=100&offset=300)

Distinct Ranks

Rank Return a list of unique names for a given rank. (?rank=genus)
Habitat This uses a wildcard so a query for ?habitat=sand will return any habitat containing the word sand (e.g. sandstone)
Country This uses a wildcard so a query for ?country=land will return any country containing the word land (e.g. England, Ireland etc)
Min Elevation This is measured in meters. Query on specimen found at or above a specific elevation (?min_elevation=1200)
Max Elevation This is measured in meters. Query on specimen found at or below a specific elevation (?max_elevation=1200)
Limit Limit the number of specimen returned on large requests (?limit=100)
Offset Used to paginate large requests when paired with the limit argument (this would return records 301-400: ?limit=100&offset=300)

Decimal Coordinate

Coord Return a list of specimens by decimal coordinates. (?coord=lat,lon)
R (radius) Define a specific radius in kilometers (if radius is not defined it will default to 5km). (?coord=latitude,longitude&r=radius)
Limit Limit the number of specimen returned on large requests (?limit=100)
Offset Used to paginate large requests when paired with the limit argument (this would return records 301-400: ?limit=100&offset=300)
Distinct You can select a list of distinct species, genus or subfamilies in the area. (?coord=latitude,longitude&r=radius&distinct=rank)

Recent Images

Since (recently added images) Return a list of images that were recently added to antweb. (?since=7 returns all images added in the last 7 days)
Img Type Specify which images you would like to see. H = head shots, D = dorsal shots, P = profile shots and L = labels. (?since=7&img_type=h returns all head shots added in the last 7 days)

Examples

A query for all specimen of genus Technomyrmex found near The California Academy of Sciences:

A query for all specimen of the genus Tetramorium that were identified in the 1970’s:

A query for all specimen of genus Acanthognathus with a limit of 100 records returned and an offset of 200 records (meaning records 201 – 300 were returned):

A query for all holotypes in the database that have geo data: