import requests import json url = "https://community-open-weather-map.p.rapidapi.com/weather" querystring = {"q":"Warsaw,pl","lat":"0","lon":"0","callback":"test","id":"2172797","lang":"null","units":""metric" or "imperial"","mode":"xml, html"} headers = { 'x-rapidapi-key': "a89d3385a6msh89ae7d5ccfb8e0bp1d22e8jsn710cdceeb838", 'x-rapidapi-host': "community-open-weather-map.p.rapidapi.com" } response = requests.request("GET", url, headers=headers, params=querystring) obj = response.text x = json.loads(obj) print(x)