Skip to content

Instantly share code, notes, and snippets.

Created January 6, 2021 00:33
What would you like to do?
An example on connecting to the Fireflies API with Python 3
# An example to get some data using the Fireflies GraphQL API
import requests
headers = {"Authorization": "Bearer YOUR-TOKEN-GOES-HERE"}
def run_query(query): # A simple function to use to make the API call. Note the json= section.
request ='', json={'query': query}, headers=headers)
if request.status_code == 200:
return request.json()
raise Exception("Query failed to run by returning code of {}. {}".format(request.status_code, query))
# The GraphQL query (with a few aditional bits included) itself defined as a multi-line string.
query = """
user {
result = run_query(query) # Execute the query
recent_transcript = result["data"]["user"]["recent_transcript"] # Drill down the dictionary
print("Most recent transcript from user - {}".format(recent_transcript))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment