API
Search the source code of 129 million sites from your own code. You pay $0.05 a search against your account balance, with no subscription. Regex, boolean, and TLD filters all work, and nothing is locked behind a higher tier.
Start in a minute. Create a key on your account page (the API unlocks after your first top-up), then run a search:
curl -G "https://www.searchwebcode.com/api/v1/search" \
-H "Authorization: Bearer $SWC_KEY" \
--data-urlencode 'q="wp-content/plugins/woocommerce"'
Authentication
Send your key as a Bearer token on every request. Create and revoke keys on your account page. A key spends your balance, so keep it like a password. We store only a hash of it, so a lost key can't be recovered: revoke it and make a new one.
Authorization: Bearer swc_live_xxxxxxxxxxxxxxxxxxxxxxxx
Search
GETPOST /api/v1/search
Send parameters in the query string (GET) or a JSON body (POST, handy for long regex). One endpoint handles every kind of query.
Parameters
| Name | Type | Default | Notes |
|---|---|---|---|
q | string | required | The search. Boolean (OR, parentheses, "quoted phrases") is detected automatically. See the syntax guide. |
regex | bool | false | Treat q as a regular expression. Can't be combined with ignore_case. |
ignore_case | bool | false | Case-insensitive substring match. |
tld | string | any | Restrict to a top-level domain, like com or io. |
limit | int | 100 | Results per page, 1 to 1000. |
offset | int | 0 | Where to resume. Pass the next_offset from the last response. |
counts_only | bool | false | Free. Return the match count with no results, to size a query before you spend. |
Response
{
"query": "\"wp-content/plugins/woocommerce\"",
"count_kind": "estimated",
"total": 4185023,
"estimated_matches": 4185023,
"candidate_total": 4185023,
"verified_hits": 96,
"scan_capped": true,
"next_offset": 512,
"elapsed_ms": 231,
"results": [
{
"domain": "example.com",
"url": "https://example.com/",
"tld": "com",
"rank": 48210,
"occurrences": 3,
"snippet": { "text": "...href='/wp-content/plugins/woocommerce/...", "match_start": 8, "match_end": 38 }
}
],
"charged_cents": 5,
"balance_cents": 1495
}
Reading the count
The engine verifies matches against real page source, so it tells you exactly how sure it is:
| count_kind | What total means |
|---|---|
exact | The true number of matching sites. |
estimated | A candidate count. Use estimated_matches, an ~N figure from a verified sample. |
partial | The query is broad, so only verified_hits of the scanned window are confirmed. total is a candidate ceiling, not a match count. Page deeper to reach more. |
Boolean queries also return a terms array with each arm's candidate count, which is the quickest way to spot the one term that made a query broad.
Pagination and export
Results arrive one page at a time. When a response includes next_offset, pass it back as offset for the next page. When next_offset is missing, you have reached the end. Set limit=1000 to move through a large export faster.
offset=0 -> { ..., "next_offset": 1000 }
offset=1000 -> { ..., "next_offset": 2000 }
offset=... -> { ... } # no next_offset means done
Billing
- $0.05 per search, taken from your account balance. No subscription.
- Paging is free. A search and all of its pages are one charge, so a 100,000-domain export costs a single 5 cents. Only a new, different query charges again.
counts_only=trueis always free.- Every response returns
charged_cents(0 or 5) and your remainingbalance_cents. - An empty balance returns 402. Top up here.
Examples
Boolean: sites using ServiceTitan or Housecall Pro booking
curl -G "https://www.searchwebcode.com/api/v1/search" \
-H "Authorization: Bearer $SWC_KEY" \
--data-urlencode 'q="scheduler.servicetitan.com/book/" OR "book.housecallpro.com/book/"'
Regex: reverse Google Analytics lookup
curl -G "https://www.searchwebcode.com/api/v1/search" \
-H "Authorization: Bearer $SWC_KEY" \
--data-urlencode 'q=UA-\d{4,10}-\d' --data-urlencode 'regex=true'
Size a query free, then export it
# free: how big is it?
curl -G ".../api/v1/search" -H "Authorization: Bearer $SWC_KEY" \
--data-urlencode 'q=.myshopify.com' --data-urlencode 'counts_only=true'
# then export it (one charge, page with next_offset)
curl -G ".../api/v1/search" -H "Authorization: Bearer $SWC_KEY" \
--data-urlencode 'q=.myshopify.com' --data-urlencode 'limit=1000'
Errors
| Status | Meaning |
|---|---|
400 | Bad query: missing q, invalid regex, or regex with ignore_case. The message says which. |
401 | Missing, invalid, or revoked key. |
402 | Not enough balance. Top up. |
429 | Too fast. Slow down and respect Retry-After. |
502, 503 | Backend briefly unavailable. Retry. |
A broad query that runs past the scan window is not an error. It returns 200 with count_kind:"partial" and a next_offset so you can keep going.