/** * Census SDK — typed API client for the U.S. Census Bureau Data API. * * Standalone — no MCP server required. Usage: * * import { queryCensus, searchVariables } from "us-gov-open-data-mcp/sdk/census"; * * const data = await queryCensus("2023/acs/acs1", "NAME,B01001_001E", "state:*"); * console.log(data.headers, data.rows); * * Requires CENSUS_API_KEY env var. Get one at https://api.census.gov/data/key_signup.html */ /** Transformed Census query result: first row becomes headers, rest becomes rows. */ export interface CensusQueryResult { headers: string[]; rows: string[][]; } /** Census Variable. */ export interface CensusVariable { label?: string; concept?: string; predicateType?: string; } /** Census Variable Match. */ export interface CensusVariableMatch { id: string; label: string; concept: string; } /** Census Dataset. */ export interface CensusDataset { path: string; name: string; description: string; } /** Commonly used Census API variable codes. */ export declare const commonVariables: { readonly NAME: "Geographic area name"; readonly B01001_001E: "Total population"; readonly B01002_001E: "Median age"; readonly B02001_002E: "White alone population"; readonly B02001_003E: "Black/African American alone"; readonly B03003_003E: "Hispanic/Latino population"; readonly B19013_001E: "Median household income"; readonly B19001_001E: "Household income distribution (total)"; readonly B19301_001E: "Per capita income"; readonly B25077_001E: "Median home value (owner-occupied)"; readonly B25064_001E: "Median gross rent"; readonly B25003_001E: "Housing tenure (total occupied)"; readonly B25003_002E: "Owner-occupied housing units"; readonly B25003_003E: "Renter-occupied housing units"; readonly B17001_002E: "Population below poverty level"; readonly B15003_022E: "Bachelor's degree"; readonly B15003_023E: "Master's degree"; readonly B15003_025E: "Doctorate degree"; readonly B23025_002E: "In labor force"; readonly B23025_005E: "Unemployed"; }; /** Datasets. */ export declare const datasets: CensusDataset[]; /** * Query the Census Bureau Data API. * The raw API returns a 2D string array; this transforms it into { headers, rows }. */ export declare function queryCensus(dataset: string, variables: string, forGeo: string, inGeo?: string, extra?: Record): Promise; /** * Search for Census variable names/codes by keyword within a dataset. * Fetches the dataset's variables.json and filters locally. */ export declare function searchVariables(dataset: string, keyword: string, maxResults?: number): Promise; /** An area's key ACS 5-year indicators. */ export interface PlaceProfile { name: string; geography: "state" | "county" | "place" | "zcta"; fips: string; year: number; population: number | null; medianHouseholdIncome: number | null; medianAge: number | null; povertyRatePct: number | null; unemploymentRatePct: number | null; medianHomeValue: number | null; medianGrossRent: number | null; bachelorsOrHigherPct: number | null; /** Caveats, e.g. a top-coded median ("$2,000,000 or more"). */ notes?: string[]; } /** * Latest ACS 5-year release: year Y is published in December of Y+1, so * before December the newest is two years back. */ export declare function latestAcs5Year(now?: Date): number; /** * Key ACS 5-year indicators for a state, county, city/town (place) or ZIP * code area (ZCTA): population, income, age, poverty, unemployment, housing * costs and education. */ export declare function getPlaceProfile(opts: { state?: string; county?: string; place?: string; zcta?: string; year?: number; }): Promise; /** Clear cached responses. */ export declare function clearCache(): void; //# sourceMappingURL=sdk.d.ts.map