/** * EIA SDK — typed API client for the U.S. Energy Information Administration API v2. * * Standalone — no MCP server required. Usage: * * import { queryEia } from "us-gov-open-data-mcp/sdk/eia"; * * Requires EIA_API_KEY env var — register at https://www.eia.gov/opendata/register.php */ /** Eia Response. */ export interface EiaResponse { response: { total: number; data: EiaObservation[]; description?: string; dateFormat?: string; frequency?: string; }; request?: Record; } /** Eia Observation. */ export interface EiaObservation { period: string; value: number | string | null; units?: string; unit?: string; "series-description"?: string; seriesDescription?: string; series?: string; stateDescription?: string; stateid?: string; stateId?: string; sectorName?: string; sectorid?: string; msn?: string; process?: string; [key: string]: unknown; } /** Eia Route. */ export interface EiaRoute { path: string; description: string; frequency: string[]; facets?: string[]; } /** EIA State Energy Data System (SEDS) MSN codes for state energy profiles. */ export declare const sedsMsnCodes: { readonly TETCB: "Total energy consumption (trillion BTU)"; readonly TETCD: "Total energy consumption per capita"; readonly TEPRB: "Total energy production (trillion BTU)"; readonly ESTCB: "Electricity total consumption"; readonly CLTCB: "Coal consumption"; readonly NNTCB: "Natural gas consumption"; readonly PATCB: "Petroleum consumption (all products)"; readonly RETCB: "Renewable energy consumption"; readonly NUETB: "Nuclear energy consumption"; readonly ELISB: "Electricity interstate flow"; readonly TETXB: "Total energy expenditures"; }; /** Routes. */ export declare const routes: EiaRoute[]; /** * Query the EIA API v2. * Uses bracket-style params: data[0], facets[series][], sort[0][column], etc. * String arrays produce repeated keys automatically via createClient. */ export declare function queryEia(route: string, params?: Record): Promise; /** "/electricity/retail-sales/data/" → "electricity/retail-sales". */ export declare function normalizeRoute(route: string): string; /** What a route offers: child routes, or (at a leaf) its facets, data columns and frequencies. */ export interface EiaRouteInfo { route: string; name: string | null; description: string | null; routes?: { id: string; name: string | null; description: string | null; }[]; frequencies?: { id: string; description: string | null; }[]; facets?: { id: string; description: string | null; }[]; data?: { id: string; units: string | null; }[]; startPeriod?: string | null; endPeriod?: string | null; defaultFrequency?: string | null; } /** Metadata for a route in the EIA v2 tree (the root when empty). */ export declare function getRouteInfo(route?: string): Promise; /** Values a facet can take on a route (e.g. stateid → CA, TX, …). */ export declare function getFacetValues(route: string, facet: string): Promise<{ id: string; name: string | null; }[]>; /** * Data from any EIA v2 leaf route, newest first unless sorted otherwise. * Facet filters map to `facets[][]` and data columns to `data[]`. */ export declare function queryRoute(route: string, opts?: { data?: string[]; facets?: Record; frequency?: string; start?: string; end?: string; length?: number; offset?: number; sortAscending?: boolean; }): Promise; /** Get petroleum data (spot prices, gasoline, diesel). */ export declare function getPetroleum(opts?: { product?: string; frequency?: string; start?: string; end?: string; length?: number; offset?: number; }): Promise; /** Get electricity data (retail sales, prices, etc.). */ export declare function getElectricity(opts?: { state?: string; sector?: string; dataType?: string; frequency?: string; start?: string; end?: string; length?: number; offset?: number; }): Promise; /** Get natural gas prices. */ export declare function getNaturalGas(opts?: { process?: string; frequency?: string; start?: string; end?: string; length?: number; offset?: number; }): Promise; /** Get state energy profile data (SEDS). */ export declare function getStateEnergy(opts?: { state?: string; msn?: string; start?: string; end?: string; length?: number; offset?: number; }): Promise; /** Get total energy overview. */ export declare function getTotalEnergy(opts?: { msn?: string; frequency?: string; start?: string; end?: string; length?: number; offset?: number; }): Promise; /** Clear cached responses. */ export declare function clearCache(): void; //# sourceMappingURL=sdk.d.ts.map