How to get segment ID for an existing camera?

Hi,

I’m using the Telraam API to get a current snapshot of the traffic, but I’m only interested in the values of distinct stations. However, I wonder how I can get the segment ID for them? Via the telraam map, I can get the location ID, but this seems not be part of the API response. Am I’m missing something here? I couldn’t find any further information to this.

Hi Philipp,

Welcome!

We don’t have a location id, only a segment id. The response of the traffic_snapshot is a Geojson and you can find the segment_id in the features. See the screenshot:

Hope that’s an answer to your question!

Hi Dave,

thanks for your quick reply. I mean the id that’s in the URL for a single station, such as Telraam | Kalmünter Weg - I assume 9000004616 is the ID? But where do I find then the according segment_id for this example?

9000004616 is the segment_id in your example. It’s possible to have multiple cameras on one segment_id however, but we show the data per segment not per camera.
The cameras can be found in the api via the instance_ids

Ahhh, now I got it! I was confused as the variable name in the url is location, while in the API it is called segment_id - maybe this can be aligned in the future?

Thanks a lot!

Sorry for bothering again, but the segment_id is NOT the same as the location from the url. I passed the whole JSON response from the traffic snapshot and at least for the example above there is no segment_Id with “9000004616”. Also taking some of the segment_ids from the response and inserting them in the URL only works for a few (mostly the 5- or 6-digit).
I’m again confused

Sorry for bothering again, but the segment_id is NOT the same as the location from the url.

Philip, it is the same thing. Believe me :slight_smile:

So what call do you make on the traffic snapshot? Can you paste it here?