Skip to content

Program for calling APIs that require only an API key and return results in a json format

Notifications You must be signed in to change notification settings

bensfisher/api-caller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

This program should work with any API that requires an api key, an arbitrary set of search arguments, and returns the results in a json format. This has been successfully tested on the New York Times API and the regulations.gov API.

Example

Begin by initializing the api_call with your API key and the url for the API.

from api_caller import api_call

key = 'yourapikey'
url = 'apiurl'

call = api_call(key=key, url=url)

To submit the call, provide the name for the API key argument used by the API being queried. For example, the argument name for the NYT is 'api-key', as opposed to 'api_key' for regulations.gov.

keyvar = 'nameofkeyargument'

call(keyvar=keyvar, arg1=arg1, arg2=arg2...)

The call function returns the results as a dictionary object.

About

Program for calling APIs that require only an API key and return results in a json format

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages