ESIID Lookup: Address to Plans

Resolve a customer's address to their electric meter (ESIID), then use it to find the right TDSP and fetch plan pricing. This is the recommended flow for address-based integrations.

Two APIs

This guide uses both Compare Power APIs. ESIID lookups go to https://esiid.api.comparepower.com. Plan searches go to https://pricing.api.comparepower.com. Neither requires authentication.

1. Search for an Address

Pass the customer's street address (at least 4 characters) and optionally a ZIP code to narrow results:

JavaScript
const response = await fetch(
  "https://esiid.api.comparepower.com/api/esiids?address=Richmond+Ave&zip_code=77006"
);
const esiids = await response.json();

// The API returns { message: "..." } when no results found
if (!Array.isArray(esiids)) {
  console.log("No results:", esiids.message);
  return;
}

When no ESIIDs match the address, the API returns { "message": "no results found..." } instead of an empty array. Always check with Array.isArray() before iterating.

The address parameter requires at least 4 characters. Include the ZIP code when possible to reduce false matches — Texas has many duplicate street names.

2. Pick the Right ESIID

The search may return multiple results (apartments, businesses, and meters at the same address). Filter for the best match:

JavaScript
// Filter for active residential meters
const residential = esiids.filter(
  (e) => e.status === "Active" && e.premise_type === "Residential"
);

// If no residential, fall back to any active ESIID
const candidates = residential.length ? residential : esiids.filter(
  (e) => e.status === "Active"
);

const bestMatch = candidates[0];
console.log(bestMatch.esiid);         // "1008901006120840492100"
console.log(bestMatch.duns);          // "957877905" (CenterPoint)
console.log(bestMatch.premise_type);  // "Residential"

Always check status — inactive ESIIDs belong to disconnected or decommissioned meters. Filter for "Active" to avoid showing plans for meters that can't be enrolled.

3. Get the TDSP from the ESIID

Each ESIID record includes a duns field — this is the TDSP DUNS number. It maps directly to the tdsp_duns parameter in the Plans API:

JavaScript
// The duns field from the ESIID is the TDSP identifier
const tdspDuns = bestMatch.duns;  // "957877905"

// This is the same value used in tdsp_duns for plan searches
// "957877905" = CenterPoint Energy (Houston area)

Field name varies by API

The ESIID API returns duns, but the TDSPs API returns duns_number. The Plans API accepts it as the query parameter tdsp_duns. The underlying value is always the same 9-digit DUNS code.

See the TDSP Reference for the full mapping of DUNS codes to utility names and service territories.

4. Fetch Plans for That TDSP

Use the DUNS number to search plans with pricing at standard usage levels. This is the same flow as the Plan Comparison Guide:

JavaScript
const params = new URLSearchParams({ tdsp_duns: tdspDuns, current: "true" });
params.append("display_usage", "500");
params.append("display_usage", "1000");
params.append("display_usage", "2000");

const plansResponse = await fetch(
  `https://pricing.api.comparepower.com/api/plans?${params}`
);
const plans = await plansResponse.json();

console.log(`Found ${plans.length} plans for TDSP ${tdspDuns}`);

Full Example

End-to-end: address in, priced plans out.

Complete Example
async function getPlansForAddress(address, zipCode) {
  // Step 1: Search for ESIIDs at this address
  const params = new URLSearchParams({ address });
  if (zipCode) params.set("zip_code", zipCode);

  const esiidRes = await fetch(
    "https://esiid.api.comparepower.com/api/esiids?" + params
  );
  const esiids = await esiidRes.json();

  // The API returns { message: "..." } when no results found
  if (!Array.isArray(esiids) || !esiids.length) {
    throw new Error("No ESIIDs found for address: " + address);
  }

  // Step 2: Pick the best match (active residential preferred)
  const active = esiids.filter((e) => e.status === "Active");
  const residential = active.filter(
    (e) => e.premise_type === "Residential"
  );
  const bestMatch = residential[0] || active[0] || esiids[0];

  // Step 3: Extract the TDSP DUNS
  const tdspDuns = bestMatch.duns;

  // Step 4: Fetch plans with pricing
  const planParams = new URLSearchParams({ tdsp_duns: tdspDuns, current: "true" });
  planParams.append("display_usage", "500");
  planParams.append("display_usage", "1000");
  planParams.append("display_usage", "2000");

  const plansRes = await fetch(
    "https://pricing.api.comparepower.com/api/plans?" + planParams
  );
  const plans = await plansRes.json();

  return {
    esiid: bestMatch.esiid,
    tdspDuns,
    address: bestMatch.address,
    plans: plans.map((plan) => ({
      name: plan.key,
      prices: plan.expected_prices,
      documents: plan.document_links,
    })),
  };
}

// Usage
const result = await getPlansForAddress("Richmond Ave", "77006");
console.log(result.esiid);        // "1008901006120840492100"
console.log(result.tdspDuns);     // "957877905"
console.log(result.plans.length); // Number of available plans

Want to earn commissions when users sign up through your integration? Apply as a partner — it's free and takes about 5 minutes.