Create a monitor
curl --request POST \
--url https://api.hydrafetch.com/v1/web/monitors \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "Competitor pricing",
"schedule": {
"every": "1h"
},
"targets": [
{
"type": "pages",
"urls": [
"https://example.com/pricing"
],
"selector": [
"#pricing",
".plan-card"
],
"ignore": [
"Last updated",
"/^Visitors: \\d+$/"
],
"triggerOn": [
"price",
"/sold out/i"
],
"scrapeOptions": {
"formats": [
"markdown"
],
"onlyMainContent": true,
"includeTags": [
"<string>"
],
"excludeTags": [
"<string>"
],
"removeBase64Images": true,
"blockAds": true,
"dismissCookies": true,
"dismissPopups": true,
"render": true,
"includeLinks": true,
"waitFor": 15000,
"waitForSelector": ".price",
"mobile": true,
"timeout": 50500,
"location": {
"country": "us",
"languages": [
"en-US",
"en"
]
},
"headers": {},
"preferStructure": true,
"maxAge": 302400000
},
"goal": "the Pro plan price drops below $50 a month"
}
],
"retentionDays": 30,
"email": "off"
}
'import requests
url = "https://api.hydrafetch.com/v1/web/monitors"
payload = {
"name": "Competitor pricing",
"schedule": { "every": "1h" },
"targets": [
{
"type": "pages",
"urls": ["https://example.com/pricing"],
"selector": ["#pricing", ".plan-card"],
"ignore": ["Last updated", "/^Visitors: \d+$/"],
"triggerOn": ["price", "/sold out/i"],
"scrapeOptions": {
"formats": ["markdown"],
"onlyMainContent": True,
"includeTags": ["<string>"],
"excludeTags": ["<string>"],
"removeBase64Images": True,
"blockAds": True,
"dismissCookies": True,
"dismissPopups": True,
"render": True,
"includeLinks": True,
"waitFor": 15000,
"waitForSelector": ".price",
"mobile": True,
"timeout": 50500,
"location": {
"country": "us",
"languages": ["en-US", "en"]
},
"headers": {},
"preferStructure": True,
"maxAge": 302400000
},
"goal": "the Pro plan price drops below $50 a month"
}
],
"retentionDays": 30,
"email": "off"
}
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({
name: 'Competitor pricing',
schedule: {every: '1h'},
targets: [
{
type: 'pages',
urls: ['https://example.com/pricing'],
selector: ['#pricing', '.plan-card'],
ignore: ['Last updated', '/^Visitors: \d+$/'],
triggerOn: ['price', '/sold out/i'],
scrapeOptions: {
formats: ['markdown'],
onlyMainContent: true,
includeTags: ['<string>'],
excludeTags: ['<string>'],
removeBase64Images: true,
blockAds: true,
dismissCookies: true,
dismissPopups: true,
render: true,
includeLinks: true,
waitFor: 15000,
waitForSelector: '.price',
mobile: true,
timeout: 50500,
location: {country: 'us', languages: ['en-US', 'en']},
headers: {},
preferStructure: true,
maxAge: 302400000
},
goal: 'the Pro plan price drops below $50 a month'
}
],
retentionDays: 30,
email: 'off'
})
};
fetch('https://api.hydrafetch.com/v1/web/monitors', 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.hydrafetch.com/v1/web/monitors",
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([
'name' => 'Competitor pricing',
'schedule' => [
'every' => '1h'
],
'targets' => [
[
'type' => 'pages',
'urls' => [
'https://example.com/pricing'
],
'selector' => [
'#pricing',
'.plan-card'
],
'ignore' => [
'Last updated',
'/^Visitors: \\d+$/'
],
'triggerOn' => [
'price',
'/sold out/i'
],
'scrapeOptions' => [
'formats' => [
'markdown'
],
'onlyMainContent' => true,
'includeTags' => [
'<string>'
],
'excludeTags' => [
'<string>'
],
'removeBase64Images' => true,
'blockAds' => true,
'dismissCookies' => true,
'dismissPopups' => true,
'render' => true,
'includeLinks' => true,
'waitFor' => 15000,
'waitForSelector' => '.price',
'mobile' => true,
'timeout' => 50500,
'location' => [
'country' => 'us',
'languages' => [
'en-US',
'en'
]
],
'headers' => [
],
'preferStructure' => true,
'maxAge' => 302400000
],
'goal' => 'the Pro plan price drops below $50 a month'
]
],
'retentionDays' => 30,
'email' => 'off'
]),
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.hydrafetch.com/v1/web/monitors"
payload := strings.NewReader("{\n \"name\": \"Competitor pricing\",\n \"schedule\": {\n \"every\": \"1h\"\n },\n \"targets\": [\n {\n \"type\": \"pages\",\n \"urls\": [\n \"https://example.com/pricing\"\n ],\n \"selector\": [\n \"#pricing\",\n \".plan-card\"\n ],\n \"ignore\": [\n \"Last updated\",\n \"/^Visitors: \\\\d+$/\"\n ],\n \"triggerOn\": [\n \"price\",\n \"/sold out/i\"\n ],\n \"scrapeOptions\": {\n \"formats\": [\n \"markdown\"\n ],\n \"onlyMainContent\": true,\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"removeBase64Images\": true,\n \"blockAds\": true,\n \"dismissCookies\": true,\n \"dismissPopups\": true,\n \"render\": true,\n \"includeLinks\": true,\n \"waitFor\": 15000,\n \"waitForSelector\": \".price\",\n \"mobile\": true,\n \"timeout\": 50500,\n \"location\": {\n \"country\": \"us\",\n \"languages\": [\n \"en-US\",\n \"en\"\n ]\n },\n \"headers\": {},\n \"preferStructure\": true,\n \"maxAge\": 302400000\n },\n \"goal\": \"the Pro plan price drops below $50 a month\"\n }\n ],\n \"retentionDays\": 30,\n \"email\": \"off\"\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.hydrafetch.com/v1/web/monitors")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Competitor pricing\",\n \"schedule\": {\n \"every\": \"1h\"\n },\n \"targets\": [\n {\n \"type\": \"pages\",\n \"urls\": [\n \"https://example.com/pricing\"\n ],\n \"selector\": [\n \"#pricing\",\n \".plan-card\"\n ],\n \"ignore\": [\n \"Last updated\",\n \"/^Visitors: \\\\d+$/\"\n ],\n \"triggerOn\": [\n \"price\",\n \"/sold out/i\"\n ],\n \"scrapeOptions\": {\n \"formats\": [\n \"markdown\"\n ],\n \"onlyMainContent\": true,\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"removeBase64Images\": true,\n \"blockAds\": true,\n \"dismissCookies\": true,\n \"dismissPopups\": true,\n \"render\": true,\n \"includeLinks\": true,\n \"waitFor\": 15000,\n \"waitForSelector\": \".price\",\n \"mobile\": true,\n \"timeout\": 50500,\n \"location\": {\n \"country\": \"us\",\n \"languages\": [\n \"en-US\",\n \"en\"\n ]\n },\n \"headers\": {},\n \"preferStructure\": true,\n \"maxAge\": 302400000\n },\n \"goal\": \"the Pro plan price drops below $50 a month\"\n }\n ],\n \"retentionDays\": 30,\n \"email\": \"off\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hydrafetch.com/v1/web/monitors")
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 \"name\": \"Competitor pricing\",\n \"schedule\": {\n \"every\": \"1h\"\n },\n \"targets\": [\n {\n \"type\": \"pages\",\n \"urls\": [\n \"https://example.com/pricing\"\n ],\n \"selector\": [\n \"#pricing\",\n \".plan-card\"\n ],\n \"ignore\": [\n \"Last updated\",\n \"/^Visitors: \\\\d+$/\"\n ],\n \"triggerOn\": [\n \"price\",\n \"/sold out/i\"\n ],\n \"scrapeOptions\": {\n \"formats\": [\n \"markdown\"\n ],\n \"onlyMainContent\": true,\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"removeBase64Images\": true,\n \"blockAds\": true,\n \"dismissCookies\": true,\n \"dismissPopups\": true,\n \"render\": true,\n \"includeLinks\": true,\n \"waitFor\": 15000,\n \"waitForSelector\": \".price\",\n \"mobile\": true,\n \"timeout\": 50500,\n \"location\": {\n \"country\": \"us\",\n \"languages\": [\n \"en-US\",\n \"en\"\n ]\n },\n \"headers\": {},\n \"preferStructure\": true,\n \"maxAge\": 302400000\n },\n \"goal\": \"the Pro plan price drops below $50 a month\"\n }\n ],\n \"retentionDays\": 30,\n \"email\": \"off\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"status": "active",
"pausedReason": "user",
"schedule": {
"every": "15m"
},
"targets": [
{
"type": "pages",
"urls": [
"https://example.com/pricing"
],
"id": "<string>",
"selector": [
"#pricing",
".plan-card"
],
"ignore": [
"Last updated",
"/^Visitors: \\d+$/"
],
"triggerOn": [
"price",
"/sold out/i"
],
"scrapeOptions": {
"formats": [
"markdown"
],
"onlyMainContent": true,
"includeTags": [
"<string>"
],
"excludeTags": [
"<string>"
],
"removeBase64Images": true,
"blockAds": true,
"dismissCookies": true,
"dismissPopups": true,
"render": true,
"includeLinks": true,
"waitFor": 15000,
"waitForSelector": ".price",
"mobile": true,
"timeout": 50500,
"location": {
"country": "us",
"languages": [
"en-US",
"en"
]
},
"headers": {},
"preferStructure": true,
"maxAge": 302400000
},
"goal": "the Pro plan price drops below $50 a month"
}
],
"webhook": {
"url": "<string>",
"events": [
"change"
]
},
"retentionDays": 123,
"email": "off",
"nextRunAt": "<string>",
"lastRunAt": "<string>",
"lastCheck": {
"id": "<string>",
"status": "running",
"trigger": "scheduled",
"totalPages": 123,
"same": 123,
"changed": 123,
"new": 123,
"removed": 123,
"error": 123,
"creditsUsed": 123,
"startedAt": "<string>",
"finishedAt": "<string>"
},
"createdAt": "<string>"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "url must be a valid URL"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Missing X-API-Key header. Agents: https://hydrafetch.com/auth.md"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_CREDITS",
"message": "Insufficient credits"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "WORKSPACE_BANNED",
"message": "This workspace has been suspended and cannot make API requests."
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Job not found"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "IDEMPOTENCY_IN_PROGRESS",
"message": "A request with this Idempotency-Key is still running."
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "UPSTREAM_UNREACHABLE",
"message": "The origin did not respond to any attempt we made."
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "TOO_MANY_REQUESTS",
"message": "Rate limit exceeded for this workspace and plan."
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "SERVICE_UNAVAILABLE",
"message": "The summary and json formats are not available."
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}Create a monitor
Watch pages on a schedule and get told when they change. The first check runs within a minute and records each page; later checks report what changed. One credit per page checked. Paid plans only.
POST
/
v1
/
web
/
monitors
Create a monitor
curl --request POST \
--url https://api.hydrafetch.com/v1/web/monitors \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "Competitor pricing",
"schedule": {
"every": "1h"
},
"targets": [
{
"type": "pages",
"urls": [
"https://example.com/pricing"
],
"selector": [
"#pricing",
".plan-card"
],
"ignore": [
"Last updated",
"/^Visitors: \\d+$/"
],
"triggerOn": [
"price",
"/sold out/i"
],
"scrapeOptions": {
"formats": [
"markdown"
],
"onlyMainContent": true,
"includeTags": [
"<string>"
],
"excludeTags": [
"<string>"
],
"removeBase64Images": true,
"blockAds": true,
"dismissCookies": true,
"dismissPopups": true,
"render": true,
"includeLinks": true,
"waitFor": 15000,
"waitForSelector": ".price",
"mobile": true,
"timeout": 50500,
"location": {
"country": "us",
"languages": [
"en-US",
"en"
]
},
"headers": {},
"preferStructure": true,
"maxAge": 302400000
},
"goal": "the Pro plan price drops below $50 a month"
}
],
"retentionDays": 30,
"email": "off"
}
'import requests
url = "https://api.hydrafetch.com/v1/web/monitors"
payload = {
"name": "Competitor pricing",
"schedule": { "every": "1h" },
"targets": [
{
"type": "pages",
"urls": ["https://example.com/pricing"],
"selector": ["#pricing", ".plan-card"],
"ignore": ["Last updated", "/^Visitors: \d+$/"],
"triggerOn": ["price", "/sold out/i"],
"scrapeOptions": {
"formats": ["markdown"],
"onlyMainContent": True,
"includeTags": ["<string>"],
"excludeTags": ["<string>"],
"removeBase64Images": True,
"blockAds": True,
"dismissCookies": True,
"dismissPopups": True,
"render": True,
"includeLinks": True,
"waitFor": 15000,
"waitForSelector": ".price",
"mobile": True,
"timeout": 50500,
"location": {
"country": "us",
"languages": ["en-US", "en"]
},
"headers": {},
"preferStructure": True,
"maxAge": 302400000
},
"goal": "the Pro plan price drops below $50 a month"
}
],
"retentionDays": 30,
"email": "off"
}
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({
name: 'Competitor pricing',
schedule: {every: '1h'},
targets: [
{
type: 'pages',
urls: ['https://example.com/pricing'],
selector: ['#pricing', '.plan-card'],
ignore: ['Last updated', '/^Visitors: \d+$/'],
triggerOn: ['price', '/sold out/i'],
scrapeOptions: {
formats: ['markdown'],
onlyMainContent: true,
includeTags: ['<string>'],
excludeTags: ['<string>'],
removeBase64Images: true,
blockAds: true,
dismissCookies: true,
dismissPopups: true,
render: true,
includeLinks: true,
waitFor: 15000,
waitForSelector: '.price',
mobile: true,
timeout: 50500,
location: {country: 'us', languages: ['en-US', 'en']},
headers: {},
preferStructure: true,
maxAge: 302400000
},
goal: 'the Pro plan price drops below $50 a month'
}
],
retentionDays: 30,
email: 'off'
})
};
fetch('https://api.hydrafetch.com/v1/web/monitors', 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.hydrafetch.com/v1/web/monitors",
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([
'name' => 'Competitor pricing',
'schedule' => [
'every' => '1h'
],
'targets' => [
[
'type' => 'pages',
'urls' => [
'https://example.com/pricing'
],
'selector' => [
'#pricing',
'.plan-card'
],
'ignore' => [
'Last updated',
'/^Visitors: \\d+$/'
],
'triggerOn' => [
'price',
'/sold out/i'
],
'scrapeOptions' => [
'formats' => [
'markdown'
],
'onlyMainContent' => true,
'includeTags' => [
'<string>'
],
'excludeTags' => [
'<string>'
],
'removeBase64Images' => true,
'blockAds' => true,
'dismissCookies' => true,
'dismissPopups' => true,
'render' => true,
'includeLinks' => true,
'waitFor' => 15000,
'waitForSelector' => '.price',
'mobile' => true,
'timeout' => 50500,
'location' => [
'country' => 'us',
'languages' => [
'en-US',
'en'
]
],
'headers' => [
],
'preferStructure' => true,
'maxAge' => 302400000
],
'goal' => 'the Pro plan price drops below $50 a month'
]
],
'retentionDays' => 30,
'email' => 'off'
]),
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.hydrafetch.com/v1/web/monitors"
payload := strings.NewReader("{\n \"name\": \"Competitor pricing\",\n \"schedule\": {\n \"every\": \"1h\"\n },\n \"targets\": [\n {\n \"type\": \"pages\",\n \"urls\": [\n \"https://example.com/pricing\"\n ],\n \"selector\": [\n \"#pricing\",\n \".plan-card\"\n ],\n \"ignore\": [\n \"Last updated\",\n \"/^Visitors: \\\\d+$/\"\n ],\n \"triggerOn\": [\n \"price\",\n \"/sold out/i\"\n ],\n \"scrapeOptions\": {\n \"formats\": [\n \"markdown\"\n ],\n \"onlyMainContent\": true,\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"removeBase64Images\": true,\n \"blockAds\": true,\n \"dismissCookies\": true,\n \"dismissPopups\": true,\n \"render\": true,\n \"includeLinks\": true,\n \"waitFor\": 15000,\n \"waitForSelector\": \".price\",\n \"mobile\": true,\n \"timeout\": 50500,\n \"location\": {\n \"country\": \"us\",\n \"languages\": [\n \"en-US\",\n \"en\"\n ]\n },\n \"headers\": {},\n \"preferStructure\": true,\n \"maxAge\": 302400000\n },\n \"goal\": \"the Pro plan price drops below $50 a month\"\n }\n ],\n \"retentionDays\": 30,\n \"email\": \"off\"\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.hydrafetch.com/v1/web/monitors")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Competitor pricing\",\n \"schedule\": {\n \"every\": \"1h\"\n },\n \"targets\": [\n {\n \"type\": \"pages\",\n \"urls\": [\n \"https://example.com/pricing\"\n ],\n \"selector\": [\n \"#pricing\",\n \".plan-card\"\n ],\n \"ignore\": [\n \"Last updated\",\n \"/^Visitors: \\\\d+$/\"\n ],\n \"triggerOn\": [\n \"price\",\n \"/sold out/i\"\n ],\n \"scrapeOptions\": {\n \"formats\": [\n \"markdown\"\n ],\n \"onlyMainContent\": true,\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"removeBase64Images\": true,\n \"blockAds\": true,\n \"dismissCookies\": true,\n \"dismissPopups\": true,\n \"render\": true,\n \"includeLinks\": true,\n \"waitFor\": 15000,\n \"waitForSelector\": \".price\",\n \"mobile\": true,\n \"timeout\": 50500,\n \"location\": {\n \"country\": \"us\",\n \"languages\": [\n \"en-US\",\n \"en\"\n ]\n },\n \"headers\": {},\n \"preferStructure\": true,\n \"maxAge\": 302400000\n },\n \"goal\": \"the Pro plan price drops below $50 a month\"\n }\n ],\n \"retentionDays\": 30,\n \"email\": \"off\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hydrafetch.com/v1/web/monitors")
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 \"name\": \"Competitor pricing\",\n \"schedule\": {\n \"every\": \"1h\"\n },\n \"targets\": [\n {\n \"type\": \"pages\",\n \"urls\": [\n \"https://example.com/pricing\"\n ],\n \"selector\": [\n \"#pricing\",\n \".plan-card\"\n ],\n \"ignore\": [\n \"Last updated\",\n \"/^Visitors: \\\\d+$/\"\n ],\n \"triggerOn\": [\n \"price\",\n \"/sold out/i\"\n ],\n \"scrapeOptions\": {\n \"formats\": [\n \"markdown\"\n ],\n \"onlyMainContent\": true,\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"removeBase64Images\": true,\n \"blockAds\": true,\n \"dismissCookies\": true,\n \"dismissPopups\": true,\n \"render\": true,\n \"includeLinks\": true,\n \"waitFor\": 15000,\n \"waitForSelector\": \".price\",\n \"mobile\": true,\n \"timeout\": 50500,\n \"location\": {\n \"country\": \"us\",\n \"languages\": [\n \"en-US\",\n \"en\"\n ]\n },\n \"headers\": {},\n \"preferStructure\": true,\n \"maxAge\": 302400000\n },\n \"goal\": \"the Pro plan price drops below $50 a month\"\n }\n ],\n \"retentionDays\": 30,\n \"email\": \"off\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"status": "active",
"pausedReason": "user",
"schedule": {
"every": "15m"
},
"targets": [
{
"type": "pages",
"urls": [
"https://example.com/pricing"
],
"id": "<string>",
"selector": [
"#pricing",
".plan-card"
],
"ignore": [
"Last updated",
"/^Visitors: \\d+$/"
],
"triggerOn": [
"price",
"/sold out/i"
],
"scrapeOptions": {
"formats": [
"markdown"
],
"onlyMainContent": true,
"includeTags": [
"<string>"
],
"excludeTags": [
"<string>"
],
"removeBase64Images": true,
"blockAds": true,
"dismissCookies": true,
"dismissPopups": true,
"render": true,
"includeLinks": true,
"waitFor": 15000,
"waitForSelector": ".price",
"mobile": true,
"timeout": 50500,
"location": {
"country": "us",
"languages": [
"en-US",
"en"
]
},
"headers": {},
"preferStructure": true,
"maxAge": 302400000
},
"goal": "the Pro plan price drops below $50 a month"
}
],
"webhook": {
"url": "<string>",
"events": [
"change"
]
},
"retentionDays": 123,
"email": "off",
"nextRunAt": "<string>",
"lastRunAt": "<string>",
"lastCheck": {
"id": "<string>",
"status": "running",
"trigger": "scheduled",
"totalPages": 123,
"same": 123,
"changed": 123,
"new": 123,
"removed": 123,
"error": 123,
"creditsUsed": 123,
"startedAt": "<string>",
"finishedAt": "<string>"
},
"createdAt": "<string>"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "url must be a valid URL"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Missing X-API-Key header. Agents: https://hydrafetch.com/auth.md"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_CREDITS",
"message": "Insufficient credits"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "WORKSPACE_BANNED",
"message": "This workspace has been suspended and cannot make API requests."
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Job not found"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "IDEMPOTENCY_IN_PROGRESS",
"message": "A request with this Idempotency-Key is still running."
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "UPSTREAM_UNREACHABLE",
"message": "The origin did not respond to any attempt we made."
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "TOO_MANY_REQUESTS",
"message": "Rate limit exceeded for this workspace and plan."
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}{
"success": false,
"error": {
"code": "SERVICE_UNAVAILABLE",
"message": "The summary and json formats are not available."
},
"meta": {
"requestId": "019e8a3c-9f0b-7c12-88ab-1d2e3f4a5b6c"
}
}Headers
Any unique string up to 255 visible characters. Send the same key when you retry a request: for 12 hours a repeat returns the first answer again, with an Idempotent-Replayed: true header, without doing the work or charging a second time. A repeat that arrives while the first is still running gets 409 IDEMPOTENCY_IN_PROGRESS; the same key with a different body gets 409 IDEMPOTENCY_KEY_REUSED.
Maximum string length:
255Example:
"3f2b8c1e-retry-safe-key"
Body
application/json
Was this page helpful?