post https://enact-epex.azurefd.net/enactApi/Data/tradesFromContractId
This endpoint will return all executed trades of a contract, given the contract ID.
Using the LCPDelta Python Package
Synchronous
from lcp_delta import enact
enact_api_helper = enact.APIHelper(username, public_api_key)
response_dictionary = enact_api_helper.get_epex_trades_by_contract_id(
13735406 # the ID of a recent contract
)
print(response_dictionary)
Asynchronous (package version 1.3.0 and later)
from lcp_delta import enact
import asyncio
async def main():
enact_api_helper = enact.APIHelper(username, public_api_key)
response_dictionary = await enact_api_helper.get_epex_trades_by_contract_id_async(
13735406 # the ID of a recent contract
)
print(response_dictionary)
asyncio.run(main())
Using the API Directly
We only store data from EPEX for today and yesterday. Use the Contracts by Day endpoint to retrieve a recent contract ID to use in the request object below.