Get monitor
Get a monitor
Retrieves a single monitor with all its configuration, plus its latest snapshot and assigned tags. This is useful for checking the current state of a monitor or reading its settings before making changes.
GET
/v1/monitors/{id}bash
curl "https://api.snapshotarchive.com/v1/monitors/42" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"$client = new \GuzzleHttp\Client();
$response = $client->get('https://api.snapshotarchive.com/v1/monitors/42', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY',
'Accept' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);import requests
response = requests.get(
"https://api.snapshotarchive.com/v1/monitors/42",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
},
)
data = response.json()const response = await fetch("https://api.snapshotarchive.com/v1/monitors/42", {
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
},
});
const data = await response.json();require "net/http"
require "json"
uri = URI("https://api.snapshotarchive.com/v1/monitors/42")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer YOUR_API_KEY"
request["Accept"] = "application/json"
response = http.request(request)
data = JSON.parse(response.body)req, _ := http.NewRequest("GET", "https://api.snapshotarchive.com/v1/monitors/42", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Accept", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()The response includes a latest_snapshot object (if one exists) and an array of tags, so you don't need separate API calls to get that information.