Skip to content

FAQ

Authentication

Is authentication required to access the API?

Most endpoints require authentication, but those representing our storage of public data do not.

How does authentication work?

We answer this in the Authentication Howto page.

Industry

How can I generate a fake ESI ID for testing purposes?

The first 7 numbers in an ERCOT ESI ID are important, the rest can be alphanumeric and random. More on ESI IDs here. Below is an example function to get a valid ESI ID to use for testing in Python. If using regular expressions, the following can be used to validate ESI IDs: /10(03278|20404|08901|40051|44372|17699)([[:alnum:]]{15}|[[:alnum:]]{10})/

import random
import re

def get_valid_esi_id():
    valid_tdsp_substrings = {
        "AEP_TCC": "03278",
        "AEP_TNC": "20404",
        "CENTERPOINT": "08901",
        "TNMP": "40051",
        "ONCOR": "44372",
        "ONCOR_ALTERNATE": "17699",
    }

    tdsp_substring = random.choice(list(valid_tdsp_substrings.values()))

    # Change the range argument to 15 if you need a 22 digit esi id
    random_tail_digits = "".join([str(random.randint(0,9)) for _ in range(10)])
    valid_esi_id = f"10{tdsp_substring}{random_tail_digits}"
    return valid_esi_id

ESI_ID_REGEX = "10(03278|20404|08901|40051|44372|17699)([[:alnum:]]{15}|[[:alnum:]]{10})"

def validate_esi_id_against_regex(esi_id: str):
    return True if re.match(ESI_ID_REGEX, esi_id) else False
Back to top