NGI Data Services API

Getting Started

This API is available to all NGI data clients at no additional charge. We will continue to improve this service over time to keep making integrating NGI data as easy as possible.

To begin using the API, you’ll need the following:

A) An email address with an associated active NGI data subscription
B) An API key. If you don’t yet have your API key, please reach out to ngidata@naturalgasintel.com.

Retrieving data from the API is a two-step process:

Step 1 - Authentication Request: You pass your subscriber email address and your API key to the /auth route to retrieve an bearer/auth token. You need pass this token back to the API in order to make subsequent calls. Tokens have an expiration of 24 hours from time of issuance.

Step 2 - Data Retrieval Request: You pass the your authentication token and any other necessary parameters to your desired route to retrieve a data set.

Example two-step Daily datafeed in JSON format:

import requests
import json
""" Step 1: Retrieve JWT """
data = {
    "email":"example@example.com",  # subscriber email 
    "password":"YourAPIKey"  # insert your api key here 
}
auth_endpoint = 'https://api.ngidata.com/auth'  # url of authentication route 
response = requests.post(auth_endpoint, json=data)
key_json = json.loads(response.text)
authToken = key_json["access_token"]  # this is your JWT 
print("JWT Authentication Token: ", authToken)

""" Step 2: Pass back JWT in header of query to retrieve data """
head = {'Authorization': 'Bearer ' + authToken}
datafeed_endpoint = "https://api.ngidata.com/dailyDatafeed.json"
responseData = requests.get(datafeed_endpoint, headers=head)
data = responseData.text  # data retrieved from datafeed endpoint 
print(data)

For the full SwaggerUI documentation, please go here: https://api.ngidata.com/