Use the API - USEPA/USEEIO_API GitHub Wiki
Use of API
The public-facing API documentation is currently hosted at https://s3.amazonaws.com/useeio-api-go-swagger-staging/index.html
The base API endpoint is at https://api.edap-cluster.com/useeio/api but requires a registered API key to use it.
The API requires no special hardware or software to access and use.
Register for an API Key
To register for a key, please email the contact person and provide your:
- Name and Affiliation
- The name and a description of your application or intended use
- URLs for the application that will be using the web service (if available)
We will respond with the base URL and a unique API key for use in your application.
Connecting to the API with the api key
The x-api-key
parameter must be set to the key value in the request header
when making a request to the API. Note that adding this parameter and value to the
query string will not work.
Example query using API key
Here in an example in Python using the requests library, if your assigned key is 'myuniquekey':
import requests
base_url = 'https://api.edap-cluster.com/useeio/api'
#Now use the endpoint to return a list of available models
headers = {}
headers['x-api-key']='myuniquekey'
models_response = requests.get(base_url+'/models',headers=headers)
models_response.json()
#Returns output like
#[{'id': 'USEEIOv1.1',
# 'name': 'USEEIOv1.1',
# 'location': 'US',
# 'description': 'EPA national life cycle model of goods and services, v1.1.'}]
The example Jupyter notebook provides a full set of queries to all API endpoints and is a recommended place to see examples of use of the API.
There are also free API inspectors that can be useful to make requests of the API and get formatted data back, like the Swagger Inspector.