Get Run Credits
Retrieve the per-function credit breakdown for a completed run
https://api.lobstr.io/v1/runs/{run_hash}/creditsReturns 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
AuthorizationstringheaderrequiredYour API authentication token. Value: Token YOUR_API_KEY
Path Parameters
run_hashstringpathrequiredThe unique identifier (hash) of the run. Example: 0393be3ea6f74986906153df1c3f9894
Response Fields
run_idstringThe hash ID of the run. Example: "0393be3ea6f74986906153df1c3f9894"
total_creditsfloatTotal credits consumed by the run. Example: 116
total_resultsintegerTotal number of results collected in the run. Example: 20
breakdownarrayList of per-function credit entries, sorted by credits descending.
Show breakdown item
functionstringInternal 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.
creditsfloatCredits charged for this function. Example: 80
attemptsintegerNumber of results this function ran on. For the virtual "filters" entry this is 0.
ratesobjectCredit rates for the run's squid.
Show rates fields
credits_per_rowfloatBase cost per result. Example: 4
[function_name]floatCost per result for each enrichment function, keyed by function name. Example: "get_phone_numbers": 6
function_colorsobjectDisplay color palette for each function, used by the dashboard UI.
Show function_colors item
bg_colorstringBackground color hex. Example: "#EAFBF3"
txt_colorstringText / foreground color hex. Example: "#0F9F5F"
base_function_labelstring | nullHuman-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.
filter_breakdownarrayPer-filter credit detail when the squid charges for active filters (e.g. geo match, category match). Empty array if no filter costs apply.
Show filter_breakdown item
namestringInternal filter parameter name. Example: "geo_match"
displaystringHuman-readable filter name shown in the UI. Example: "Geo Match"
ratefloatCredits charged per result for this filter. Example: 1
creditsfloatTotal credits charged for this filter in the run. Example: 20
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"
Response
{ "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": [] }
{ "detail": "Run not found." }