Skip to content

API

For now, the API (application programming interface) allows these changes:

  • Set dynamic text overlays: to dynamicaly update overlay information text, i.e. weather information
  • Enable/disable webcam: use an external call to turn on/off image collection
  • Change live stream settings: stream from (or to) another endpoint; enable/disable webcam

These calls can be used from your own scripts or from an external cron services like https://www.easycron.com

Using the API

Get the SECRET-API-KEY from your Dashboard -> Profile settings. The WEBCAM-ID is shown in the webcams list.

API calls can be made using a curl command:

Terminal window
curl -H 'Content-Type: application/json' \
-H 'X-Auth-Email: YOUR@EMAIL' \
-H 'X-Auth-Key: SECRET-API-KEY' \
-X PUT -d '{"dynamic_text1":"TEXT"}' \
"https://webcam.io/api/webcams/WEBCAM-ID"

This could be a live example:

Terminal window
curl -H 'Content-Type: application/json' \
-H 'X-Auth-Email: account@test.com' \
-H 'X-Auth-Key: 22l7kIX0AwdMcdpo7v' \
-X PUT -d '{"dynamic_text1":"temp: 10°C hyg: 50%"}' \
"https://webcam.io/api/webcams/m7g61z"

Warning: there is a sensible API rate limit. If there are too many calls per hour, your account might be locked.

Dynamic text overlays

(also see dynamic text overlays)

Example to update the value of the dynamic_text variables:

Terminal window
curl -H 'Content-Type: application/json' \
-H 'X-Auth-Email: YOUR@EMAIL' \
-H 'X-Auth-Key: SECRET-API-KEY' \
-X PUT -d '{"dynamic_text1":"temp: 10°C hyg: 50%","dynamic_text2":"wind: NE"}' \
"https://webcam.io/api/webcams/WEBCAM-ID"

Enable/disable webcam

example call using interval field to disable/enable camera:

turn off:

Terminal window
curl -H 'Content-Type: application/json' \
-H 'X-Auth-Email: YOUR@EMAIL' \
-H 'X-Auth-Key: SECRET-API-KEY' \
-X PUT -d '{"interval": 0}' \
"https://webcam.io/api/webcams/WEBCAM-ID"

turn “on” (there is no “on”, set to 60 seconds here):

Terminal window
curl -H 'Content-Type: application/json' \
-H 'X-Auth-Email: YOUR@EMAIL' \
-H 'X-Auth-Key: SECRET-API-KEY' \
-X PUT -d '{"interval": 60}' \
"https://webcam.io/api/webcams/WEBCAM-ID"

Live stream settings

To change live stream parameters:

Terminal window
curl -H 'Content-Type: application/json' \
-H 'X-Auth-Email: YOUR@EMAIL' \
-H 'X-Auth-Key: SECRET-API-KEY' \
-X PUT -d '{"stream_enabled": true, "backup_stream_enabled": false, "stream_src_url":"rtsp://example.com", "stream_dest_url":"rtmp://dest"}' \
"https://webcam.io/api/webcams/WEBCAM-ID"

All parameters shown are optional.

Example: Setting ’{“stream_enabled”: true}’ (or false) can be used by an external scheduler to enable/disable streaming at a specific time.