Run a lighthouse test
curl --request POST \
--url https://api.speedvitals.com/v1/lighthouse-tests \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"url": "https://speedvitals.com",
"device": "macbookAirM1",
"location": "us",
"config": {
"connection": "fiber",
"video": true,
"adblock": true
}
}
'import requests
url = "https://api.speedvitals.com/v1/lighthouse-tests"
payload = {
"url": "https://speedvitals.com",
"device": "macbookAirM1",
"location": "us",
"config": {
"connection": "fiber",
"video": True,
"adblock": True
}
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://speedvitals.com',
device: 'macbookAirM1',
location: 'us',
config: {connection: 'fiber', video: true, adblock: true}
})
};
fetch('https://api.speedvitals.com/v1/lighthouse-tests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.speedvitals.com/v1/lighthouse-tests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://speedvitals.com',
'device' => 'macbookAirM1',
'location' => 'us',
'config' => [
'connection' => 'fiber',
'video' => true,
'adblock' => true
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.speedvitals.com/v1/lighthouse-tests"
payload := strings.NewReader("{\n \"url\": \"https://speedvitals.com\",\n \"device\": \"macbookAirM1\",\n \"location\": \"us\",\n \"config\": {\n \"connection\": \"fiber\",\n \"video\": true,\n \"adblock\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.speedvitals.com/v1/lighthouse-tests")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://speedvitals.com\",\n \"device\": \"macbookAirM1\",\n \"location\": \"us\",\n \"config\": {\n \"connection\": \"fiber\",\n \"video\": true,\n \"adblock\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.speedvitals.com/v1/lighthouse-tests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://speedvitals.com\",\n \"device\": \"macbookAirM1\",\n \"location\": \"us\",\n \"config\": {\n \"connection\": \"fiber\",\n \"video\": true,\n \"adblock\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"url": "https://speedvitals.com",
"device": "macbookAirM1",
"location": "us",
"config": {
"connection": "fiber",
"video": true,
"adblock": true
},
"status": "success",
"lighthouse_version": "9.6.2",
"metrics": null,
"report_url": null,
"created_at": 1657537268453,
"expires_at": 1660129268453,
"error": null
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}Lighthouse Tests
Run a lighthouse test
Runs a new lighthouse test.
POST
/
v1
/
lighthouse-tests
Run a lighthouse test
curl --request POST \
--url https://api.speedvitals.com/v1/lighthouse-tests \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"url": "https://speedvitals.com",
"device": "macbookAirM1",
"location": "us",
"config": {
"connection": "fiber",
"video": true,
"adblock": true
}
}
'import requests
url = "https://api.speedvitals.com/v1/lighthouse-tests"
payload = {
"url": "https://speedvitals.com",
"device": "macbookAirM1",
"location": "us",
"config": {
"connection": "fiber",
"video": True,
"adblock": True
}
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://speedvitals.com',
device: 'macbookAirM1',
location: 'us',
config: {connection: 'fiber', video: true, adblock: true}
})
};
fetch('https://api.speedvitals.com/v1/lighthouse-tests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.speedvitals.com/v1/lighthouse-tests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://speedvitals.com',
'device' => 'macbookAirM1',
'location' => 'us',
'config' => [
'connection' => 'fiber',
'video' => true,
'adblock' => true
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.speedvitals.com/v1/lighthouse-tests"
payload := strings.NewReader("{\n \"url\": \"https://speedvitals.com\",\n \"device\": \"macbookAirM1\",\n \"location\": \"us\",\n \"config\": {\n \"connection\": \"fiber\",\n \"video\": true,\n \"adblock\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.speedvitals.com/v1/lighthouse-tests")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://speedvitals.com\",\n \"device\": \"macbookAirM1\",\n \"location\": \"us\",\n \"config\": {\n \"connection\": \"fiber\",\n \"video\": true,\n \"adblock\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.speedvitals.com/v1/lighthouse-tests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://speedvitals.com\",\n \"device\": \"macbookAirM1\",\n \"location\": \"us\",\n \"config\": {\n \"connection\": \"fiber\",\n \"video\": true,\n \"adblock\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"url": "https://speedvitals.com",
"device": "macbookAirM1",
"location": "us",
"config": {
"connection": "fiber",
"video": true,
"adblock": true
},
"status": "success",
"lighthouse_version": "9.6.2",
"metrics": null,
"report_url": null,
"created_at": 1657537268453,
"expires_at": 1660129268453,
"error": null
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}Authorizations
Body
application/json
This is the lighthouse test body object
The url of webpage
Available options:
mobile, desktop, macbookAirM1, highEndLaptop, ipad102, galaxyTabS7, iphone13ProMax, iphone11, galaxyS10Plus, redmiNote8Pro, iphone7, galaxyA50, galaxyJ8, motoG5, redmi5A Example:
"macbookAirM1"
Available options:
us, ca, br, de, uk, nl, pl, ch, jp, in, sg, au, id, kr, tw Example:
"us"
Show child attributes
Show child attributes
Response
A lighthouse report to be returned
Available options:
mobile, desktop, macbookAirM1, highEndLaptop, ipad102, galaxyTabS7, iphone13ProMax, iphone11, galaxyS10Plus, redmiNote8Pro, iphone7, galaxyA50, galaxyJ8, motoG5, redmi5A Example:
"macbookAirM1"
Available options:
us, ca, br, de, uk, nl, pl, ch, jp, in, sg, au, id, kr, tw Example:
"us"
Available options:
idle, active, success, failed The version of the lighthouse used to generate the report
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The URL at which SpeedVitals report is accessible (Present when status is success)
Time at which the test was created. Measured in seconds since the Unix epoch.
Time at which the report will expire. Measured in seconds since the Unix epoch.
Contains error code and description(present only if status is failed)
Show child attributes
Show child attributes