There is a single API call for retrieving Probe data samples.
Note: If starttime and endtime both are not provided, the last 5 minutes of samples are returned. Also, if the frequency of probe is greater than the duration specified for samples, the request will not return any samples.
key name valid combinations
latency l, l_l, s_l
latency_percent lp, l_lp
status_code s, l_s, s_s
uptime u, l_u, s_u
health h, l_h, s_h
state_string ss, l_ss
Note:
term abbreviation
timestamp '_ts'
actual sample size '_bs'
attributes 'a'
probe URL 'c'
probe name or label 'n'
health 'h'
probe_id 'id'
uptime 'u'
status codes 's'
Obtain samples from one probe, specifying only the PROBE_ID.
curl -su <APIKEY>:U "https://api.copperegg.com/v2/revealuptime/samples.json?ids=<PROBE_ID>"
curl -s "https://<APIKEY>:U@api.copperegg.com/v2/revealuptime/samples.json?ids=<PROBE_ID>"
Response is a JSON-encoded array with a single Probe Sample Hash:
[
{
"a":{"n":"site1","c":"GET http://site1.com/"},
"id":"4ff8da3a2ca1fc10a20001e7",
"_ts":1365135660,
"_bs":5,
"l":{"0":[143,143,0,286],"60":[152,153,0,305],"120":[146,150,0,296],"180":[158,162,0,320]},
"s":{"0":{"301":2},"60":{"301":3},"120":{"301":3},"180":{"301":4}},
"h":{"0":100,"60":100,"120":100,"180":100},
"u":{"0":100,"60":100,"120":100,"180":100}
}
]
Obtain samples from two probes, specifying sample_size of 60. Default keys.
curl -su <APIKEY>:U "https://api.copperegg.com/v2/revealuptime/samples.json?sample_size=60&ids=<PROBE_ID>,<PROBE_ID>"
curl -s "https://<APIKEY>:U@api.copperegg.com/v2/revealuptime/samples.json?sample_size=60&ids=<PROBE_ID>,<PROBE_ID>"
Response is a JSON-encoded array of Probe Sample Hashes, in this case, with 60 seconds data:
[
{
"a":{"n":"site1","c":"GET http://site1.com/"},
"id":"4ff7e3122ca1fc02a00002f7",
"_ts":1365136440,
"_bs":60,
"l":{"0":[45,389,4,438],"60":[53,381,5,439],"120":[29,876,6,911]},
"s":{"0":{"200":18},"60":{"200":21},"120":{"200":18}},
"h":{"0":100,"60":100,"120":98},
"u":{"0":100,"60":100,"120":100}
},
{
"a":{"n":"site2","c":"GET http://site2.com/"},
"id":"4ff8da3a2ca1fc10a20001e7",
"_ts":1365136440,
"_bs":60,
"l":{"0":[160,161,0,321],"60":[160,152,0,312],"120":[155,161,0,316]},
"s":{"0":{"301":4},"60":{"301":3},"120":{"301":4}},
"h":{"0":100,"60":100,"120":100},
"u":{"0":100,"60":100,"120":100}
}
]
Obtain samples from a single probe, specifying starttime, endtime, and sample_size of 60 seconds. Default keys.
curl -su <APIKEY>:U "https://api.copperegg.com/v2/revealuptime/samples.json?starttime=1344195713&endtime=1344195893&sample_size=60&ids=<PROBE_ID>"
curl -s "https://<APIKEY>:U@api.copperegg.com/v2/revealuptime/samples.json?starttime=1344195713&endtime=1344195893&sample_size=60&ids=<PROBE_ID>"
Response is a JSON-encoded array with a single Probe Sample Hash:
[
{
"a":{"n":"site1","c":"GET http://site1.com/"},
"id":"4ff8da3a2ca1fc10a20001e7",
"_ts":1344195713,
"_bs":5,
"l":{"0":[143,143,0,286],"60":[152,153,0,305],"120":[146,150,0,296],"180":[158,162,0,320]},
"s":{"0":{"301":2},"60":{"301":3},"120":{"301":3},"180":{"301":4}},
"h":{"0":100,"60":100,"120":100,"180":100},
"u":{"0":100,"60":100,"120":100,"180":100}
}
]
Obtain samples from one probe, specifying sample_size of 60, and the keys l, lp, l_s, u, l_h and l_ss.
curl -su <APIKEY>:U "https://api.copperegg.com/v2/revealuptime/samples.json?sample_size=60&ids=<PROBE_ID>&keys=l,lp,l_s,u,l_h,l_ss"
curl -s "https://<APIKEY>:U@api.copperegg.com/v2/revealuptime/samples.json?sample_size=60&ids=<PROBE_ID>&keys=l,lp,l_s,u,l_h,l_ss"
Response is a JSON-encoded array with a single Probe Sample Hash:
[
{
"a":{"n":"Hires probe","c":"GET http://mywebsite.com"},
"id":"4ff9f8512ca1fc338d00000e",
"_ts":1344451560,
"_bs":60,
"l":{"0":[ 30,36,0,66 ],"60":[ 40,47,0,87 ],"120":[ 32,53,1,86 ],"180":[ 34,35,1,70 ]},
"lp":{"0":[ 0.4545, 1.0,1.0 ],"60":[ 0.4598,1.0,1.0 ],"120":[ 0.3721,0.9884,1.0 ],"180":[ 0.4857,0.9857,1.0 ]},
"l_s":{ "200":28 },
"l_h":100,
"u":{"0":100,"60":100, "120":100, "180":100},
"l_ss":{ "s":28 }
}
]
Note: Latency percent arrays contain only three values: connect, time for the first byte, and transfer.
Obtain all station data for one probe, specifying sample_size of 60, and the keys s_l, s_s, s_u, and s_h.
curl -su <APIKEY>:U "https://api.copperegg.com/v2/revealuptime/samples.json?sample_size=60&ids=<PROBE_ID>&keys=s_l,s_s,s_u,s_h"
curl -s "https://<APIKEY>:U@api.copperegg.com/v2/revealuptime/samples.json?sample_size=60&ids=<PROBE_ID>&keys=s_l,s_s,s_u,s_h"
Response is a JSON-encoded array with a single Probe Sample Hash:
[
{
"a":{"n":"site1 home", "c":"GET http://site1.net"},
"id":"4ff9f8512ca1fc338d00000e",
"_ts":1344453360,
"_bs":60,
"s_l":{
"atl":{"0":[21,47,1,69],"60":[21,23,0,44],"120":[21,24,1,46],"180":[62,23,1,86]},
"dal":{"0":[39,3,1,43],"60":[4,3,1,8],"120":[3,3,0,6],"180":[11,3,1,15]}
},
"s_s":{
"atl":{"0":{"200":3},"60":{"200":4},"120":{"200":3},"180":{"200":3}},
"dal":{"0":{"200":3},"60":{"200":4},"120":{"200":3},"180":{"200":4}}
},
"s_h":{
"atl":{"0":100,"60":100,"120":100,"180":100},
"dal":{"0":100,"60":100,"120":100,"180":100}
},
"s_u":{
"atl":{"0":100,"60":100,"120":100,"180":100},
"dal":{"0":100,"60":100,"120":100,"180":100}
}
}
]