Address lookup¶
There are two ways to do an address lookup:
-
Provide an ESI ID
-
Provide an address and a postcode. You have the option of filtering down by house number, city, and state.
Authentication Required
Requires CAN_USE_ADDRESSES_API
permissions.
-
Arguments
esiId
:String!
address
:String!
address2
:String!
city
:String!
postCode
:String!
state
:String!
-
Returns
Examples¶
Using an ESI ID¶
import pprint
import requests
# API_URL = "https://api.oeus-kraken.energy/v1/graphql/" # Prod
API_URL = "https://api.oeus-kraken.systems/v1/graphql/" # Test
HEADERS = {}
QUERY = """
query getAddress($address:String, $postCode:String, $city:String, $state:String, $esiId:String){
addressLookup(address:$address, postCode:$postCode, city:$city, state:$state, esiId:$esiId){
houseNumber
address
address2
postCode
city
state
serviceProvider
loadZone
esiId
isCustomer {
isOeCustomer
}
}
}
"""
address = "1234 Test Avenue"
post_code = "77002" # zipcode in question must be servicable by ERCOT
city = "Katy"
VARIABLES = {"address": address, "postCode": post_code, "city": city}
session = requests.Session()
session.headers.update(HEADERS)
response = session.post(
url=API_URL,
json={"query": QUERY, "variables": VARIABLES}
)
pprint.pprint(response.json())
Note: ESI ID has been modified to protect customer privacy
Using Address and Postcode¶
import pprint
import requests
# API_URL = "https://api.oeus-kraken.energy/v1/graphql/" # Prod
API_URL = "https://api.oeus-kraken.systems/v1/graphql/" # Test
HEADERS = {}
QUERY = """
query getAddress(
$address: String
$postCode: String
$city: String
$state: String
) {
addressLookup(
address: $address
postCode: $postCode
city: $city
state: $state
) {
address
postCode
city
state
serviceProvider
loadZone
esiId
}
}
"""
VARIABLES = {"address": "138", "postCode": "77541", "city": "Freeport", "state": "TX",}
session = requests.Session()
session.headers.update(HEADERS)
response = session.post(
url=API_URL,
json={"query": QUERY, "variables": VARIABLES}
)
pprint.pprint(response.json())
Note: ESI IDs has been modified to protect customer privacy
{
"data": {
"addressLookup": [
{
"houseNumber": "138",
"address": "138 DRIFTWOOD",
"postCode": "77541",
"city": "FREEPORT",
"state": "TX",
"serviceProvider": "CENTERPOINT",
"esiId": "100890000000022100",
"loadZone": "LZ_HOUSTON"
},
{
"houseNumber": "138",
"address": "138 JOLLY BOAT LN",
"postCode": "77541",
"city": "FREEPORT",
"state": "TX",
"serviceProvider": "CENTERPOINT",
"esiId": "1008900000000610100",
"loadZone": "LZ_HOUSTON"
},
{
"houseNumber": "138",
"address": "138 BALDWIN RD",
"postCode": "77541",
"city": "FREEPORT",
"state": "TX",
"serviceProvider": "CENTERPOINT",
"esiId": "1008901000000002100",
"loadZone": "LZ_HOUSTON"
},
{
"houseNumber": "138",
"address": "138 DUTCH LAKE CT",
"postCode": "77541",
"city": "FREEPORT",
"state": "TX",
"serviceProvider": "CENTERPOINT",
"esiId": "10089010033100000000100",
"loadZone": "LZ_HOUSTON"
}
}
}