Skip to end of metadata
Go to start of metadata


Finding Your Username and Access Key

You can find your Sauce Labs username and access key in the User Profile > User Settings section of your Sauce Labs dashboard.

 

Get User Concurrency

Get account concurrency limits together with current used concurrency and manual testing minutes.

Returned data shows concurrency  for main account as "ancestor" and requested user as "self".

GET /rest/v1.1/users/USERNAME/concurrency
curl -u USERNAME:API_KEY https://saucelabs.com/rest/v1.1/users/USERNAME/concurrency
Example JSON response
{
   "timestamp" : 1452260901.59655,
   "concurrency" : {
      "ancestor" : {
         "allowed" : {
            "mac" : 100,
            "real_device" : 30,
            "manual" : 100,
            "overall" : 100
         },
         "username" : "ANCESTOR_USERNAME",
         "current" : {
            "overall" : 0,
            "mac" : 0,
            "manual" : 0
         }
      },
      "self" : {
         "current" : {
            "manual" : 0,
            "mac" : 0,
            "overall" : 0
         },
         "username" : "YOUR_USERNAME",
         "allowed" : {
            "mac" : 100,
            "real_device" : 30,
            "manual" : 100,
            "overall" : 100
         }
      }
   }
}

Get User Activity

Cached: 5s

 

Get currently running job counts broken down by account and job status. Results are grouped by the job status for the requesting user and for its subaccounts. The response also includes a "totals" field that summarizes all the results.

GET /rest/v1/USERNAME/activity
curl -u USERNAME:API_KEY https://saucelabs.com/rest/v1/USERNAME/activity
Example JSON response
{
   "totals" : {
      "in progress" : 30,
      "queued" : 15,
      "all" : 45
   },
   "subaccounts" : {
      "YOUR_USERNAME" : {
         "queued" : 10,
         "in progress" : 20,
         "all" : 30
      },
      "CHILD_USERNAME" : {
         "all" : 15,
         "in progress" : 10,
         "queued" : 5
      }
   }
}

Get User Account Usage

Access historical account usage data. Returns the total number of jobs and VM time used, in seconds grouped by day.

GET /rest/v1/users/USERNAME/usage 

Parameters

start

optional

string

Usage for dates not smaller then specified.

Date in YYYY-MM-DD format.

end

optional

string

Usage for dates not greater then specified.

Date in YYYY-MM-DD format.

curl -u USERNAME:API_KEY https://saucelabs.com/rest/v1/users/USERNAME/usage
Example JSON response
{
   "usage" : [
      ["2015-3-20", [5, 467]],
      ["2015-3-1", [7, 114]]
   ],
   "username" : "USERNAME"
}