API

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

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:

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:

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:

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:

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):

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:

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.