I have a API key for the following: https://api.propublica.org/congress/v1/116/house/members.json and I am looking to be able to (in Javascript) code a user input that returns a value from the JSON.
I am not sure where or how to put my API key in the URL to get a successful return. Currently the error message I get is "unauthorized". Any help would be great!
Use Fetch API (JS) and pass it on the headers: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#supplying_request_options
And here is what you should include on the header: https://projects.propublica.org/api-docs/congress-api/#authentication
2.1m questions
2.1m answers
60 comments
57.0k users