API Key Registration

Legislative Insights uses Google AI Studio and OpenStates APIs. These services require API keys.

The application uses browser storage to save these keys. A setup screen will appear if the browser does not have a value recorded for the OpenStates API key.

Legislative Insights Homepage

The setup screen can also be accessed by clicking on the Settings button at the top of the page

Settings menu location

The setup screen has a link for the API registration page and a field for the API key.

OpenStates API Key Registration 2

Follow the instructions below to register the API keys.

OpenStates API

OpenStates is an open source project which aims to improve civic engagement at the state level by providing data and tools regarding state legislatures.

The project aggregates legislative information from all 50 states, Washington, D.C., and Puerto Rico. This information is then standardized, cleaned, and published to the public via the OpenStates API.

Legislative Insights uses the OpenStates API to populate the form at the top of the page. Follow the instructions below to register an API key.

  1. Navigate to https://openstates.org/api/register/ and sign up for an account

    OpenStates API Key Registration 3

  2. Select one of the 3rd party identity providers

    OpenStates API Key Registration 4

  3. Click on the Continue link after logging in. Note this is easy to miss (see screenshot below) and may not be visible at all (see video above)

    OpenStates API Key Registration 5

  4. Request an API key from the Account Profile page and then copy its value

    OpenStates API Key Registration 6

  5. Paste the value into the Open States API Key field on the Legislative Insights setup screen.

Google AI Studio API

A Google AI Studio API key is required in order to make calls to the LLM. Navigate to https://aistudio.google.com/app/apikey. Press the Get API key button

Google AI Studio API Key Registration 1

Select a Google Cloud project for the API key:

Google AI Studio API Key Registration 2

Copy its value:

Google AI Studio API Key Registration 3

Site Level API Keys

By default API keys are set and stored in the browser for each individual user. This avoids exposing the keys to the public internet when following the quick start guide

API keys can be set using environment variables on the Legislative Insights VM as part of a production deployment after the environment has been locked down with access restricted to authorized users.

Copyright © Dito LLC, 2022, 2025