Python module to query the Smithsonian Institution Open Access API.
A project of the Digitization Program Office, OCIO, Smithsonian.
For details of the developer tools for the Open Access API: https://www.si.edu/openaccess/devtools
For details about Smithsonian Open Access: https://www.si.edu/openaccess
To install using pip:
pip install si_openaccessOr:
python3 -m pip install si_openaccess- The module requires Python 3.6 or higher.
- The API requires you to provide your own 'api_key' value. Please register with https://api.data.gov/signup/ to get a key.
from si_openaccess import si_openaccessTo fetch content based on id/url of an object (docs):
si_openaccess.content(id=[ITEM ID], api_key=[YOUR API KEY])To fetch stats for CC0 objects/media (docs):
si_openaccess.metrics_stats(api_key=[YOUR API KEY])To fetch content based on a query against a category. art_design, history_culture or science_technology (docs):
si_openaccess.category_search(q=[SEARCH TERMS], category=[CATEGORY], start=0, rows=10, sort=[SORT], api_key=[YOUR API KEY])Values for category are:
art_designhistory_culturescience_technology
Values for sort are:
relevancyidnewestupdatedrandom
To fetch content based on a query (docs):
si_openaccess.search(q=[SEARCH TERMS], start=0, rows=10, sort=[SORT], type=[TYPE], row_group=[ROW_GROUP], api_key=[YOUR API KEY])Values for sort are:
relevancyidnewestupdatedrandom
Values for type are:
edanmdmead_collectionead_componentall
Values for row_group are:
objectsarchives
To Fetches an array of terms based term category (docs):
si_openaccess.search_terms(category=[CATEGORY], starts_with=None, api_key=[YOUR API KEY])Values for category are:
culturedata_sourcedateobject_typeonline_media_typeplacetopicunit_code
The value for starts_with is optional.