skip to Main Content

Json – Get specific content from facts API Python

This is my current code: limit = 1 api_url = 'https://api.api-ninjas.com/v1/facts?limit={}'.format(limit) response = requests.get(api_url, headers={'X-Api-Key': API_KEY}) print(response.text) I get this returned: [{"fact": "The Canadian province of New Brunswick had a bloodless war with the US state of Maine in 1839"}]…

VIEW QUESTION
Back To Top
Search