REST API v4: GET view count

You can retrieve the number of profiles in a view using an HTTP GET request:

https://api.copernica.com/v4/view/$id/count

The $id must be replaced with the numerical identifier or the name of the view for which you want to retrieve the count.

Returned fields

The method returns a JSON object with the following field:

Variable Description
count The number of profiles in the view.

JSON example

The JSON response looks like this:

{
   "count": 283495
}

PHP example

The following PHP script demonstrates how to call the API method:

// required scripts
require_once('CopernicaRestAPI.php');

// change this to your access token
$api = new CopernicaRestAPI("your-access-token", 4);

// execute the method and print the result
print_r($api->get("view/{$viewID}/count"));

This example requires the REST API class.

More information