đŸ€–
Carnot
  • Carnot - Ă„bne data
  • API opbygning
  • Guides
    • FĂ„ adgang til API
    • Forbind til API
      • Python
      • JS/ TS
      • CURL
  • Data fundament
    • Energiproduktion og forbrug
    • Spotpriser
    • Opladningsplan
    • BilopsĂŠtning
  • Use Cases
    • For dem med elbil
    • For dem med home assistant
    • For dem med varmepumpe og buffertank
  • Extras
    • Keyboard Shortcuts
Powered by GitBook
On this page
  1. Guides
  2. Forbind til API

Python

// Some code
import requests

URL="https://openapi.carnot.dk/openapi/get_predict"

PARAMS={
        "daysahead": 5,
        "energysource": "solarpower",
        "region": "dk1",
      }
      
HEADERS={
        "apikey": "{{ api-key }}",
        "username": "{{ username }}",
      }

r = requests.get(url = URL, params = PARAMS,headers=HEADERS)

data = r.json()

print(data)
PreviousForbind til APINextJS/ TS

Last updated 2 years ago