With a little help of our friends - how to use the Telraam API

I need a “little help” of our friends at Telraam with the API stuff.

it would be very nice if someone could send me a sample of a working script that reads my Telraam at:

Akkrum, Friesland Telraam

The results from the API have to be shown in Domoticz - our domotica app we use for several years now at home - as a section like this one:
Fijnstof-in-Domoticz

With that sample i probably be able to change parameters to get the right figures on the D-Dashboard - and of course - we will share the script with users who like to have that functionality.

I’m not sure he has the time, but I believe @Romain_Dalston might have the skills for this, or ideas to point you in the right direction.

Are there other data folks here with knowledge of API?

1 Like

Happy to help.
Which language?

2 Likes

is there a discord to discuss this things?
I also have a power Bi script

1 Like

No need for Discord, you can use the personal message function if you want to keep it away from public boards

Those can also be groups, so others can be invited to join as and when

:slight_smile:

Python Code for inspiration
You can use https://hoppscotch.io/ to test your calls.
Put a time_end in the future to get the latest data available

id is your location ( you can find it on the url Telraam | avenue de l'Europe)

import requests

url = "https://telraam-api.net/v1/reports/traffic"

payload = {
  "level": "segments",
  "format": "per-hour",
  "id": "9000004176",
  "time_start": "2022-10-09T20:59:22Z",
  "time_end": "2022-11-09T20:59:22Z"
}
headers = {
  "X-Api-Key": "yourapikeyfromtelraam",
  "content-type": "application/json"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)
2 Likes

thank you @Romain_Dalston
going to do some tests to see if i can get it to work - will come back later with results :nerd_face:

Thank you so much @Romain_Dalston - I had a feeling you were the person to turn to.

Hope you’re doing interesting stuff with your own device in Dalston too?

You’re welcome
We are campaiging to cut rat running from our streets, mainly on twitter.
We use Telraam data to publish numbers like:

or

I also coded a Power BI report, but didn’t do the visual part yet.
Api allows us to get the numbers we want: we mainly communicate on numbers of cars and heavy vehicles on given hours ( as we don’t count yet night traffic)

1 Like

it seems that i have missed the - o so important - first step: the editor
after some reading there was a privacy friendly editor VSCodium
have a look at:


VSCodium

this Open Source app accepts plugins like:

REST API plugin
afbeelding

this story continues