Get Run Credits
curl --request GET \
--url https://api.lobstr.io/v1/runs/{run_hash}/credits \
--header 'Authorization: <authorization>'import requests
url = "https://api.lobstr.io/v1/runs/{run_hash}/credits"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.lobstr.io/v1/runs/{run_hash}/credits', 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.lobstr.io/v1/runs/{run_hash}/credits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lobstr.io/v1/runs/{run_hash}/credits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.lobstr.io/v1/runs/{run_hash}/credits")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/runs/{run_hash}/credits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"run_id": "<string>",
"total_credits": 123,
"total_results": 123,
"breakdown": [
{
"function": "<string>",
"credits": 123,
"attempts": 123
}
],
"rates": {
"credits_per_row": 123,
"[function_name]": 123
},
"function_colors": {
"bg_color": "<string>",
"txt_color": "<string>"
},
"base_function_label": {},
"filter_breakdown": [
{
"name": "<string>",
"display": "<string>",
"rate": 123,
"credits": 123
}
]
}Run
Get Run Credits
Retrieve the per-function credit breakdown for a completed run
GET
/
v1
/
runs
/
{run_hash}
/
credits
Get Run Credits
curl --request GET \
--url https://api.lobstr.io/v1/runs/{run_hash}/credits \
--header 'Authorization: <authorization>'import requests
url = "https://api.lobstr.io/v1/runs/{run_hash}/credits"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.lobstr.io/v1/runs/{run_hash}/credits', 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.lobstr.io/v1/runs/{run_hash}/credits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lobstr.io/v1/runs/{run_hash}/credits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.lobstr.io/v1/runs/{run_hash}/credits")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/runs/{run_hash}/credits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"run_id": "<string>",
"total_credits": 123,
"total_results": 123,
"breakdown": [
{
"function": "<string>",
"credits": 123,
"attempts": 123
}
],
"rates": {
"credits_per_row": 123,
"[function_name]": 123
},
"function_colors": {
"bg_color": "<string>",
"txt_color": "<string>"
},
"base_function_label": {},
"filter_breakdown": [
{
"name": "<string>",
"display": "<string>",
"rate": 123,
"credits": 123
}
]
}Returns a detailed credit breakdown for a single run, showing how credits were spent across base scraping and any enrichment functions (e.g. phone numbers, email extraction, images). Use this to understand the cost composition of a run and identify which functions drive the most spend.
Headers
string
required
Your API authentication token. Value:
Token YOUR_API_KEYPath Parameters
string
required
The unique identifier (hash) of the run. Example:
0393be3ea6f74986906153df1c3f9894Response Fields
string
The hash ID of the run. Example:
"0393be3ea6f74986906153df1c3f9894"float
Total credits consumed by the run. Example:
116integer
Total number of results collected in the run. Example:
20array
List of per-function credit entries, sorted by credits descending.
Show breakdown item
Show breakdown item
string
Internal function name.
"base" represents the core scraping step. Enrichment functions (e.g. "get_phone_numbers", "extract_emails_from_website") appear as separate entries. "filters" is a virtual entry that groups all active filter costs.float
Credits charged for this function. Example:
80integer
Number of results this function ran on. For the virtual
"filters" entry this is 0.object
object
string | null
Human-readable display name for the base scraping step, derived from the squid’s configuration. Example:
"Export Listings (No Phone)". null if the squid has no labelled main function.array
Per-filter credit detail when the squid charges for active filters (e.g. geo match, category match). Empty array if no filter costs apply.
Credits are only charged for results that were successfully collected. Results discarded by filters (e.g. closed businesses, website filter, geo/category mismatch) are not billed.
Code Examples
curl -X GET "https://api.lobstr.io/v1/runs/0393be3ea6f74986906153df1c3f9894/credits" \
-H "Authorization: Token YOUR_API_KEY"
import requests
run_hash = "0393be3ea6f74986906153df1c3f9894"
url = f"https://api.lobstr.io/v1/runs/{run_hash}/credits"
headers = {"Authorization": "Token YOUR_API_KEY"}
response = requests.get(url, headers=headers)
data = response.json()
print(f"Total credits: {data['total_credits']}")
print(f"Total results: {data['total_results']}")
avg = data['total_credits'] / data['total_results'] if data['total_results'] else 0
print(f"Avg cost per result: {avg:.2f}")
for entry in data['breakdown']:
print(f" {entry['function']}: {entry['credits']} credits ({entry['attempts']} results)")
Response
200
{
"run_id": "0393be3ea6f74986906153df1c3f9894",
"total_credits": 116,
"total_results": 20,
"breakdown": [
{
"function": "base",
"credits": 80,
"attempts": 20
},
{
"function": "get_phone_numbers",
"credits": 36,
"attempts": 20
}
],
"rates": {
"credits_per_row": 4,
"get_phone_numbers": 6
},
"function_colors": {
"Export Listings (No Phone)": {
"bg_color": "#EAFBF3",
"txt_color": "#0F9F5F"
},
"get_phone_numbers": {
"bg_color": "#EEF2F7",
"txt_color": "#62748A"
}
},
"base_function_label": "Export Listings (No Phone)",
"filter_breakdown": []
}
404
{
"detail": "Run not found."
}