Python POST request for GraphQL API with no key:value information

Viewed 16

I am trying to query the newly released fossil fuel database API from https://fossilfuelregistry.org/api with a POST request The examples I looked at always specify which keys to return values for but their documentation is limited. I am trying to return all results using an empty dict as the query and get a (404): Not Found error code

import requests
import json

####

query = """query {}"""

url = 'https://api.fossilfuelregistry.org/graphql'
r = requests.post(url, json={'query': query})
print(r.status_code)
print(r.text)

json_data = json.loads(r.text)

Thanks for any insights you might give!!

0 Answers
Related