programmatic interface to the AntWeb

A complete programmatic interface to the AntWeb database from the California Academy of Sciences.

Linux: travis
Windows: Build status

AntWeb is a repository of ant specimen records maintained by the California Academy of Sciences. From the website's description:


Installing the package

Stable version

install.packages("AntWeb"dependencies = TRUE)
# version 0.6 

Development version

# If you don't already have the devtools package installed, run 
# install.packages("devtools") 
# unlike most packages, devtools requires additional non-R dependencies depending on your OS.  
# See → 

Quick usage guide

Function name Description Example
aw_data Search for data by taxonomic level, full species name, a bounding box, habitat, elevation or type. Search by a species name
aw_data(scientific_name = "acanthognathus brevicornis")
or by a genus
crem <- aw_data(genus = "crematogaster")
Search by a bounding box
aw_data(bbox = '37.77,-122.46,37.76,-122.47')
Search by an elevation band
aw_data(min_elevation = 1500, max_elevation = 2000)
aw_unique Obtain a list of unique levels by various taxonomic ranks aw_unique(rank = "subfamily")
genus_list <- aw_unique(rank = "genus")
aw_unique(rank = "species")
aw_images Search photos by type or time since added. aw_images(since = 5)
aw_images(since = 5, type = "h")
aw_coords Search for specimens by location and radius aw_coords(coord = "37.76,-122.45", r = 5)
aw_code Search for a specimen by record number aw_code(occurrenceid = "CAS:ANTWEB:alas188691")
aw_map Map georeferenced data adf <- aw_data(genus = "acanthognathus", georeferenced = TRUE)


To cite package ‘AntWeb’ in publications use:
  'Karthik Ram' (2014). AntWeb: programmatic interface
  to the AntWeb. R package version 0.6.7.
A BibTeX entry for LaTeX users is
    title = {AntWeb: programmatic interface to the AntWeb},
    author = {'Karthik Ram'},
    year = {2014},
    note = {package version 0.6.7},
    url = {},

Questions, bugs, and suggestions

Please file any bugs or questions as issues or send in a pull request.

ropensci footer


Version 0.7

  • Fixed bug with maps (stringsasFactors be damned)
  • Package now supports additional search parameters including Country, Type, bounding box (bbox), min/max elevation, min/max date (of collection), limits and offsets

Version 0.6.1

  • Migrated all functions to the new API
  • All functions now have a limit, allowing users to query large genera
  • Added more options for search (including elevation bands, date ranges, habitat, and type)

Version: 0.5

  • Bug fixes related to lat/long being renamed.

Version: 0.4

  • Initial CRAN release

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.7 by 'Karthik Ram', 5 years ago

Report a bug at

Browse source code at

Authors: 'Karthik Ram' [aut, cre]

Documentation:   PDF Manual  

CC0 license

Imports rjson, plyr, assertthat, httr, leafletR

See at CRAN