curl -X POST https://api.screenshotcenter.com/v1/screenshot \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://app.example.com/login",
"steps": [
{"command": "type", "element": "#email", "value": "[email protected]"},
{"command": "type", "element": "#password", "value": "your-password"},
{"command": "click", "element": "#submit"},
{"command": "sleep", "value": "3"},
{"command": "navigate", "value": "https://app.example.com/dashboard"},
{"command": "sleep", "value": "2"}
],
"trackers": [
{
"id": "mrr",
"name": "Monthly Recurring Revenue",
"name_type": "string",
"selector": ".mrr-value",
"value": "document.querySelector(\".mrr-value\").textContent",
"value_type": "number"
}
]
}'
const shot = await client.screenshot.create({
url: 'https://app.example.com/login',
steps: [
{ command: 'type', element: '#email', value: '[email protected]' },
{ command: 'type', element: '#password', value: 'your-password' },
{ command: 'click', element: '#submit' },
{ command: 'sleep', value: '3' },
{ command: 'navigate', value: 'https://app.example.com/dashboard' },
{ command: 'sleep', value: '2' },
],
trackers: [
{ id: 'mrr', name: 'Monthly Recurring Revenue', name_type: 'string',
selector: '.mrr-value', value: 'document.querySelector(".mrr-value").textContent', value_type: 'number' },
],
});
console.log('MRR:', shot.trackers?.[0]?.return?.[0]?.value);
shot = client.screenshot.create(
url="https://app.example.com/login",
steps=[
{"command": "type", "element": "#email", "value": "[email protected]"},
{"command": "type", "element": "#password", "value": "your-password"},
{"command": "click", "element": "#submit"},
{"command": "sleep", "value": "3"},
{"command": "navigate", "value": "https://app.example.com/dashboard"},
{"command": "sleep", "value": "2"},
],
trackers=[
{"id": "mrr", "name": "Monthly Recurring Revenue", "name_type": "string",
"selector": ".mrr-value", "value": 'document.querySelector(".mrr-value").textContent', "value_type": "number"},
],
)
print("MRR:", shot["trackers"][0]["return"][0]["value"])
$shot = $client->screenshot->create('https://app.example.com/login', [
'steps' => [
['command' => 'type', 'element' => '#email', 'value' => '[email protected]'],
['command' => 'type', 'element' => '#password', 'value' => 'your-password'],
['command' => 'click', 'element' => '#submit'],
['command' => 'sleep', 'value' => '3'],
['command' => 'navigate', 'value' => 'https://app.example.com/dashboard'],
['command' => 'sleep', 'value' => '2'],
],
'trackers' => [
['id' => 'mrr', 'name' => 'Monthly Recurring Revenue', 'name_type' => 'string',
'selector' => '.mrr-value', 'value' => 'document.querySelector(".mrr-value").textContent', 'value_type' => 'number'],
],
]);
echo 'MRR: ' . $shot['trackers'][0]['return'][0]['value'] . "\n";
shot, _ := client.Screenshot.Create("https://app.example.com/login", &sc.CreateParams{
Steps: []sc.Step{
{Command: "type", Element: "#email", Value: "[email protected]"},
{Command: "type", Element: "#password", Value: "your-password"},
{Command: "click", Element: "#submit"},
{Command: "sleep", Value: "3"},
{Command: "navigate", Value: "https://app.example.com/dashboard"},
{Command: "sleep", Value: "2"},
},
Trackers: []sc.Tracker{
{ID: "mrr", Name: "Monthly Recurring Revenue", NameType: "string",
Selector: ".mrr-value", Value: `document.querySelector(".mrr-value").textContent`, ValueType: "number"},
},
})
fmt.Println("MRR:", shot.Trackers[0].Return[0].Value)
shot = client.screenshot.create("https://app.example.com/login",
steps: [
{ command: "type", element: "#email", value: "[email protected]" },
{ command: "type", element: "#password", value: "your-password" },
{ command: "click", element: "#submit" },
{ command: "sleep", value: "3" },
{ command: "navigate", value: "https://app.example.com/dashboard" },
{ command: "sleep", value: "2" },
],
trackers: [
{ id: "mrr", name: "Monthly Recurring Revenue", name_type: "string",
selector: ".mrr-value", value: 'document.querySelector(".mrr-value").textContent', value_type: "number" },
]
)
puts "MRR: #{shot["trackers"][0]["return"][0]["value"]}"
var params = new ScreenshotParams()
.url("https://app.example.com/login")
.steps(List.of(
new Step("type", "#email", "[email protected]"),
new Step("type", "#password", "your-password"),
new Step("click", "#submit", null),
new Step("sleep", null, "3"),
new Step("navigate", null, "https://app.example.com/dashboard"),
new Step("sleep", null, "2")
))
.trackers(List.of(
new Tracker("mrr", "Monthly Recurring Revenue", "string",
"document.querySelector(\".mrr-value\").textContent", "number").selector(".mrr-value")
))
.size("page");
var shot = client.screenshot().create(params);
System.out.println("MRR: " + shot.getTrackers().get(0).getReturn().get(0).getValue());
var shot = await client.Screenshot.CreateAsync(new ScreenshotParams {
Url = "https://app.example.com/login",
Steps = new[] {
new Step { Command = "type", Element = "#email", Value = "[email protected]" },
new Step { Command = "type", Element = "#password", Value = "your-password" },
new Step { Command = "click", Element = "#submit" },
new Step { Command = "sleep", Value = "3" },
new Step { Command = "navigate", Value = "https://app.example.com/dashboard" },
new Step { Command = "sleep", Value = "2" },
},
Trackers = new[] {
new Tracker { Id = "mrr", Name = "Monthly Recurring Revenue", NameType = "string",
Selector = ".mrr-value", Value = "document.querySelector(\".mrr-value\").textContent", ValueType = "number" },
},
});
Console.WriteLine($"MRR: {shot.Trackers[0].Return[0].Value}");