Get Started with the Enact API

Upon subscribing to the Enact API, you should be issued a Username and Public API Key from the Enact team.

Please contact [email protected] if you have not, or submit feedback via the speech-bubble icon in the top-right of the Enact website.


Using the LCPDelta Python package

With the LCPDelta Python package, you can interact with our Enact API as per the following general example:

from lcp_delta import enact

enact_api_helper = enact.APIHelper(<USERNAME>, <PUBLIC_KEY>)
response = enact_api_helper.<API_METHOD>(<METHOD_PARAMETERS>)
from lcp_delta import enact
import asyncio

async def main():
	enact_api_helper = enact.APIHelper(<USERNAME>, <PUBLIC_KEY>)
	response = await enact_api_helper.<API_METHOD>(<METHOD_PARAMETERS>)
    
asyncio.run(main())

The values in the example are as follows:

  • USERNAME: Your Enact API username.
  • PUBLIC_KEY: Your Enact API public key.
  • API_METHOD: A specific API helper method.
  • METHOD_PARAMETERS: The API helper method parameters that specify and refine your data search.

Responses from the Series Data and History of Forecast methods will be in pandas DataFrame format, and the rest of the methods will return Python dictionaries.

For details on specific API helper methods and parameters, please refer to our API Reference where we include examples from our Python package with each endpoint.



Using Custom Code

If you are using your own custom code to interact with the Enact API directly, you can follow the pattern detailed in the below general examples:

var httpClient = new HttpClient();

httpClient.BaseAddress = new Uri(@"https://enactapifd.lcp.uk.com");
httpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer <BEARER_TOKEN>");

var result = await httpClient.PostAsync("/EnactAPI/<ENDPOINT_PATH>", <REQUEST_OBJECT>);
string contents = await result.Content.ReadAsStringAsync();
curl -X POST \
https://enactapifd.lcp.uk.com/EnactAPI/<ENDPOINT_PATH>
-H 'Content-Type: application/json' \
-d '<REQUEST_OBJECT>' \
-H 'Authorization: Bearer <BEARER_TOKEN>'
-H 'cache-control: no-cache'

The values in the examples are as follows:

  • BEARER_TOKEN: Your bearer token retrieved from the Enact auth endpoint (see Managing Bearer Tokens).
  • ENDPOINT_PATH: The relative path to a specific Enact API endpoint (please note that the base URL may be different for certain endpoints).
  • REQUEST_OBJECT: An object with fields that specify and refine your data search.

Responses from direct endpoints will be in JSON format.

For details on specific Enact API endpoints, please refer to our API Reference.