LibraryOfCongress / api.congress.gov

congress.gov API
601 stars 38 forks source link

Is there an API to get the text version of the congressional records? #258

Closed houcharlie closed 2 days ago

houcharlie commented 2 weeks ago

Is there an API to get the text version of the congressional records, including house, senate and extension of remarks sections? An example result I want is https://www.congress.gov/118/crec/2024/06/11/170/98/modified/CREC-2024-06-11-pt1-PgH3685.htm

It would be even better if the API client can directly return the json format.

jonquandt commented 2 weeks ago

The GovInfo API has that functionality.

Here's how you would access that.

Package summary in json for that issue of the Record: https://api.govinfo.gov/packages/CREC-2024-06-11/summary?api_key=DEMO_KEY

Look at the granulesLink to generate a list of individual portions of the Record.

You can access that specific entry here:

https://api.govinfo.gov/packages/CREC-2024-06-11/granules/CREC-2024-06-11-pt1-PgH3685/summary?api_key=DEMO_KEY

And the text version is:

https://api.govinfo.gov/packages/CREC-2024-06-11/granules/CREC-2024-06-11-pt1-PgH3685/htm?api_key=DEMO_KEY

If you already have a key for accessing the Congress.gov API, you can use that same key for the GovInfo API.