Skip to main content
U.S. flag

An official website of the United States government

Explore ScienceBase's programmatic connections and capabilities.

Programmatic Use of ScienceBase

Content in the ScienceBase catalog is stored in a standardized item model with consistent information facets (e.g., title, abstract, keywords, etc.) and is accessible through both a web browser and an application programming interface (API). This enables querying capabilities and makes it possible to integrate content into dynamic collections and connect data to external applications and programmatic workflows. 

For access to more detailed instructions on using the ScienceBase API, please contact sciencebase@usgs.gov. USGS users have additional access to internal documentation and instructional materials. 

 

ScienceBase Information Model 

The ScienceBase schema is formatted in ScienceBase JSON (JavaScript Object Notation). All items in ScienceBase have the same core model. For more information on the ScienceBase JSON schema, see the item core model documentation. To view any ScienceBase item in JSON format, add "?format=json" to the URL, e.g., https://www.sciencebase.gov/catalog/item/58f7fadae4b0b7ea5451fc5c?format=json. There are optional extensions to this model for more specific or advanced purposes.

 

REST Service Architecture 

ScienceBase is based on a REST service architecture and supports REST API calls. JSON is used as the data transfer format for reading items and manipulating data in ScienceBase (e.g., create, read, update, delete). Users can retrieve information about items, create new items, or update or delete existing items. REST clients can be used for these types of interactions.

 

Python and R modules 

Two code modules are available to facilitate programmatic interactions with ScienceBase. The majority of scripted work in ScienceBase is based on functions in these modules.

Python: https://github.com/DOI-USGS/sciencebasepy

R: https://github.com/DOI-USGS/sbtools

 

Apply ScienceBase Services in other Applications

Structured content in ScienceBase can be ingested and parsed by external applications and websites. For example, the following websites display content and files that are hosted in ScienceBase:

There are additional capabilities that can enable metadata harvesting. For example, metadata records in ScienceBase can be harvested by the USGS Science Data Catalog via the OAI-PMH protocol.