API


 

General

 

The purpose of this API service is to update existing and add new webcams automatically to your website. A typical API user is a webcam directory website.

 

iGoCam has developed a well documented and easy-to-use API. The API service is free.

 

To use the API, you need to request an API key. Just drop us an email and tell us who you are and what the API will be used for!

 

The API produces a list in JSON format, containing data for all webcams hosted by iGoCam. This includes permanent links to the webcams that can be used to embed the live feed to your website.

 

All cameras owned by iGoCam may be embedded to any website, provided that a clearly visible and working link to "https://igocam.com" is added for each camera.


 

Start here!

 

  1. Request an API key. Just email and tell us who you are and what the API will be used for!
  2. Test your API key with this URL in a web browser: https://igocam.com/rest/api?api_key=[your API key]
  3. Study the JSON structure and the code snippet below and start coding!
  4. Run your API script no more than once a day. For testing purposes you may run your API script more often.

 


 

Json structure

 


 

Code example in PHP

 


          <!doctype html>
          <html>
          <head>
          <meta charset="utf-8">
          <title>Example</title>
          </head>
          <body>
          <?php
              // Get data     
              $url = "https://igocam.com/rest/api?api_key=[your API key]"; 
                
              //  Curl 
              $ch = curl_init(); 
              curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
              curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
              curl_setopt($ch, CURLOPT_URL,$url); 
              $result=curl_exec($ch); 
              curl_close($ch); 

              $json = json_decode( $result, true );  

              foreach ($json as $key => $value){ 
                  $name = $value["name"];
                  $permanent_link = $value["permanent_link"]; 
                  //Save to your database, here we echo as a test
                  echo $name;
                  echo "<br>";
                  echo $permanent_link;
                  echo "<br>";
              }
          ?>
          </body>
          </html>