2.0.20220809 • Published 2 years ago

@maxim_mazurok/gapi.client.civicinfo v2.0.20220809

Weekly downloads
52
License
MIT
Repository
github
Last release
2 years ago

TypeScript typings for Google Civic Information API v2

Provides polling places, early vote locations, contest data, election officials, and government representatives for U.S. residential addresses. For detailed description please check documentation.

Installing

Install typings for Google Civic Information API:

npm install @types/gapi.client.civicinfo@v2 --save-dev

Usage

You need to initialize Google API client in your code:

gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});

Then load api client wrapper:

gapi.client.load('civicinfo', 'v2', () => {
  // now we can use gapi.client.civicinfo
  // ...
});

After that you can use Google Civic Information API resources:

/*
Searches for political divisions by their natural name or OCD ID.
*/
await gapi.client.civicinfo.divisions.search({  });

/*
List of available elections to query.
*/
await gapi.client.civicinfo.elections.electionQuery({  });

/*
Looks up information relevant to a voter based on the voter's registered address.
*/
await gapi.client.civicinfo.elections.voterInfoQuery({ address: "address",  });

/*
Looks up political geography and representative information for a single address.
*/
await gapi.client.civicinfo.representatives.representativeInfoByAddress({  });

/*
Looks up representative information for a single geographic division.
*/
await gapi.client.civicinfo.representatives.representativeInfoByDivision({ ocdId: "ocdId",  });
2.0.20220721

2 years ago

2.0.20220630

2 years ago

2.0.20220727

2 years ago

2.0.20220802

2 years ago

2.0.20220615

2 years ago

2.0.20220809

2 years ago

2.0.20220513

2 years ago

2.0.20220531

2 years ago

2.0.20220526

2 years ago

2.0.20220516

2 years ago

2.0.20220412

2 years ago

2.0.20211209

2 years ago

2.0.20211211

2 years ago

2.0.20210809

3 years ago

2.0.20210629

3 years ago

2.0.20210616

3 years ago

2.0.20210108

3 years ago

2.0.20210105

3 years ago

2.0.20201214

3 years ago

2.0.20201211

3 years ago

2.0.20201022

4 years ago