← Lead Scoring Calculator
Your token

Lead Scoring Calculator API

Reading the file, finding the columns, scoring every lead (fit, activity, intent, red flags), the grades and every download run free in the browser and need no API. The API is for the one metered step: send a description of the business and a summary of the lead file, and get back, as JSON, the ideal-customer settings the scores should use, each with the exact words or file value it came from. The page builds this input for you, checks every setting against your words and your file, and shows which leads change grade.

Base URL: https://api.skillsafe.ai/v1/app-api. Every response is {"data": ...} or {"error": {"code", "message"}}; read error.code and error.message rather than the HTTP status alone.

The task field

This app has one task. Always send "task": "tune".

taskWhat it doesReply
tuneSets the ideal customer (sizes, industries, excluded industries, regions, revenue, teams, extra decision-maker and influencer titles, competitors) for the business described.One JSON object

Input fields

Every field is a string; file_facts and current_model hold JSON text. task, business, file_facts and current_model are required.

FieldMeaning
task"tune"
businessWhat you sell and to whom, in your words (up to 1,500 characters).
file_facts{leads, columns_found, industries, titles, countries, company_sizes, revenue}: industries, titles and countries are lists of {value, count} as written in the file; company_sizes is {min, median, max, unknown}; revenue is {min, median, max} or null. No names or emails.
current_modelThe settings in use now, in the shape of the reply's model.
clipped_noteEmpty, or a sentence saying only the most common values are listed.

The reply

job.output.output is text holding one JSON object. model has size_min, size_max, too_small_below, revenue_min, revenue_max (integers) and industries, excluded_industries, regions, departments, decision_titles, influencer_titles, competitors (lists of strings). why has one {setting, basis, quote} per setting (size, too_small, industries, excluded_industries, regions, revenue, departments, decision_titles, influencer_titles, competitors): basis is description (the quote is exact words from business), file (the quote is one exact value from file_facts) or kept. Before using a setting, check it as the page does: the quote really is in the description or the file, regions are real countries, ranges are ranges, and every competitor is named in the description. If the balance ran low, truncated is true and the object may stop early; the page keeps what arrived whole.

Worked example

Input (input.json), from the page's "SaaS trial sign-ups" example:

{
  "task": "tune",
  "business": "We sell marketing automation software to e-commerce and SaaS companies with 50 to 500 employees in the US, Canada and the UK. Our buyers are marketing leaders (VP Marketing, Head of Growth, CMO).",
  "file_facts": "{\"leads\":14,\"columns_found\":[\"Email\",\"First name\",\"Last name\",\"Company\",\"Job title\",\"Company size\",\"Industry\",\"Revenue\",\"Country\",\"Lead source\",\"Last activity\",\"Demo request\",\"Pricing page visits\",\"Webinar\",\"Email clicks\",\"Email opens\",\"Category research (intent)\"],\"industries\":[{\"value\":\"E-commerce\",\"count\":2},{\"value\":\"Software\",\"count\":2},{\"value\":\"Consulting\",\"count\":1},{\"value\":\"Education\",\"count\":1},{\"value\":\"Fintech\",\"count\":1},{\"value\":\"Information Technology\",\"count\":1},{\"value\":\"Manufacturing\",\"count\":1},{\"value\":\"Marketing Services\",\"count\":1},{\"value\":\"SaaS\",\"count\":1},{\"value\":\"Veterinary\",\"count\":1}],\"titles\":[{\"value\":\"CTO\",\"count\":1},{\"value\":\"Director of Demand Generation\",\"count\":1},{\"value\":\"Founder & CEO\",\"count\":1},{\"value\":\"Head of Growth\",\"count\":1},{\"value\":\"Marketing Analyst\",\"count\":1},{\"value\":\"Marketing Coordinator\",\"count\":1},{\"value\":\"Marketing Manager\",\"count\":1},{\"value\":\"Office Manager\",\"count\":1},{\"value\":\"Owner\",\"count\":1},{\"value\":\"Procurement Manager\",\"count\":1},{\"value\":\"Senior Product Manager\",\"count\":1},{\"value\":\"Software Engineer\",\"count\":1},{\"value\":\"Student\",\"count\":1},{\"value\":\"VP of Marketing\",\"count\":1}],\"countries\":[{\"value\":\"United States\",\"count\":5},{\"value\":\"United Kingdom\",\"count\":2},{\"value\":\"Australia\",\"count\":1},{\"value\":\"Brazil\",\"count\":1},{\"value\":\"Canada\",\"count\":1},{\"value\":\"Germany\",\"count\":1},{\"value\":\"India\",\"count\":1},{\"value\":\"Ireland\",\"count\":1},{\"value\":\"Nigeria\",\"count\":1}],\"company_sizes\":{\"min\":3,\"median\":95,\"max\":2400,\"unknown\":3},\"revenue\":{\"min\":400000,\"median\":12000000,\"max\":400000000}}",
  "current_model": "{\"size_min\":50,\"size_max\":1000,\"too_small_below\":10,\"industries\":[\"Software\",\"SaaS\",\"Technology\",\"Internet\",\"E-commerce\"],\"excluded_industries\":[],\"regions\":[\"United States\",\"Canada\",\"United Kingdom\"],\"revenue_min\":1000000,\"revenue_max\":1000000000,\"departments\":[],\"decision_titles\":[],\"influencer_titles\":[],\"competitors\":[]}",
  "clipped_note": ""
}

Reply:

{"model":{"size_min":50,"size_max":500,"too_small_below":10,"industries":["E-commerce","SaaS"],"excluded_industries":[],"regions":["United States","Canada","United Kingdom"],"revenue_min":1000000,"revenue_max":1000000000,"departments":["marketing","growth"],"decision_titles":[],"influencer_titles":[],"competitors":[]},"why":[{"setting":"size","basis":"description","quote":"50 to 500 employees"},{"setting":"too_small","basis":"kept","quote":""},{"setting":"industries","basis":"description","quote":"e-commerce and SaaS companies"},{"setting":"excluded_industries","basis":"kept","quote":""},{"setting":"regions","basis":"kept","quote":""},{"setting":"revenue","basis":"kept","quote":""},{"setting":"departments","basis":"description","quote":"marketing leaders"},{"setting":"decision_titles","basis":"kept","quote":""},{"setting":"influencer_titles","basis":"kept","quote":""},{"setting":"competitors","basis":"kept","quote":""}]}

Errors

HTTPWhat to do
401The token is missing, expired or a guest token on a run. Get a personal token on the token page.
402The balance is below what the run reserves. Top up at skillsafe.ai/account/billing.
400The body is not a JSON object of the fields above, or a required field is missing or empty.
429Wait and retry with the same Idempotency-Key.

Step 1 — a tiny client helper

One function that sends JSON and unwraps the {data, error} envelope.

BASE="https://api.skillsafe.ai/v1/app-api"
TOKEN="paste-your-token-here"   # from https://lead-scoring-calculator.skillsafe.ai/tokens.html
api() { # api METHOD PATH [JSON-BODY]
  curl -s -X "$1" "$BASE$2" -H "Content-Type: application/json" \
    ${TOKEN:+-H "Authorization: Bearer $TOKEN"} ${3:+--data "$3"}
}

Step 2 — a token

A guest token is enough for /me and /estimate. A run is metered, so it needs your personal token: sign in on the token page and copy it.

# a guest token (enough for /me and /estimate); a run needs your personal token from /tokens.html
TOKEN=$(curl -s -X POST "$BASE/guest" -H "Content-Type: application/json" -d '{"slug":"lead-scoring-calculator"}' | jq -r '.data.token')

Step 3 — who am I, and my balance

subject_type is guest or user; credits is the balance (1 credit = $0.0001).

api GET /me | jq '.data | {subject_type, credits}' 

Step 4 — price a run for free

/estimate charges nothing and starts no job. hold_credits is the amount reserved while a run is in flight, not the price; the run is charged what it uses.

# input.json: the run input object - {"task": "tune", "business": "We sell marketing automation software to e-commerce and SaaS companies with 50 to 500 employees in the US, Canada and the UK. Our buyers are marketing leaders (VP Marketing, Head of Growth, CMO).", "file_facts": "{...}", "current_model": "{\"size_min\":50,\"size_max\":1000,\"too_small_below\":10,\"industries\":[\"Software\",\"SaaS\",\"Technology\",\"Internet\",\"E-commerce\"],\"excluded_industries\":[],\"regions\":[\"United States\",\"Canada\",\"United Kingdom\"],\"revenue_min\":1000000,\"revenue_max\":1000000000,\"departments\":[],\"decision_titles\":[],\"influencer_titles\":[],\"competitors\":[]}", "clipped_note": ""}
api POST /estimate "$(cat input.json)" | jq '.data | {hold_credits, min_credits, model, model_alias, markup_bps, warnings}' 

Step 5 — run it and wait for the job

Send an Idempotency-Key derived from the input: a retry with the same key is never billed twice.

KEY="lead-scoring-calculator:tune:$(shasum -a 256 input.json | cut -c1-16):a1"
JOB=$(curl -s -X POST "$BASE/run" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: $KEY" --data @input.json | jq -r '.data.job_id')
while :; do
  J=$(api GET "/jobs/$JOB"); S=$(echo "$J" | jq -r '.data.status')
  case "$S" in succeeded|failed|cancelled) break;; esac; sleep 2
done
echo "$J" | jq -r '.data.output.output' > reply.json   # one JSON object: model and why
echo "$J" | jq '.data | {charged_credits, truncated}' 

Step 6 — or stream it

/run-stream sends Server-Sent Events while the job runs and the finished job at the end.

# Server-Sent Events: tick/delta events while the job runs, then a final event with the job
curl -N -s -X POST "$BASE/run-stream" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: lead-scoring-calculator:tune:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json