Find a domain from a name
curl --request GET \
--url https://api.prefetch.io/resolve \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.prefetch.io/resolve"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.prefetch.io/resolve', 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.prefetch.io/resolve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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.prefetch.io/resolve"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.prefetch.io/resolve")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prefetch.io/resolve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"query": "Delta",
"results": [
{
"name": "Delta Air Lines",
"domain": "delta.com",
"url": "https://delta.com",
"confidence": 0.92,
"source": "index"
},
{
"name": "DELTA",
"domain": "delta.nl",
"url": "https://delta.nl",
"confidence": 0.79,
"source": "index"
}
],
"count": 2,
"live_used": false,
"warnings": []
},
"meta": {
"requestId": "b4e3d2c1-8a7b-4c3d-9e2f-1a3b5c7d9e1f",
"durationMs": 41
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}Discovery
GET /resolve
Turn a company, brand or product name into the domain of its official website. Costs 1 credit โ 3 with a live lookup, 0 when nothing matches.
GET
/
resolve
Find a domain from a name
curl --request GET \
--url https://api.prefetch.io/resolve \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.prefetch.io/resolve"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.prefetch.io/resolve', 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.prefetch.io/resolve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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.prefetch.io/resolve"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.prefetch.io/resolve")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prefetch.io/resolve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"query": "Delta",
"results": [
{
"name": "Delta Air Lines",
"domain": "delta.com",
"url": "https://delta.com",
"confidence": 0.92,
"source": "index"
},
{
"name": "DELTA",
"domain": "delta.nl",
"url": "https://delta.nl",
"confidence": 0.79,
"source": "index"
}
],
"count": 2,
"live_used": false,
"warnings": []
},
"meta": {
"requestId": "b4e3d2c1-8a7b-4c3d-9e2f-1a3b5c7d9e1f",
"durationMs": 41
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}Overview
Every other endpoint takes a URL./resolve is how you get one when all you have is a name: Stripe โ stripe.com, Delta โ delta.com, The Coca-Cola Company โ coca-cola.com.
Results are ranked, one per domain, and each carries a confidence from 0 to 1. Only the first result can reach 0.8 โ when it does, that is the answer; anything lower is a candidate to check. Case, accents, punctuation and legal suffixes donโt matter: โThe Coca-Cola Companyโ, โcoca-colaโ and โCoca Colaโ are the same query.
Answers come from two places:
- The name index โ about 550,000 brands, companies, websites, software products and publications, in milliseconds. Reviewed brand data always ranks first.
- A live lookup โ only with
live=true, and only when the index has no answer at 0.8 or above. Candidate domains are proposed and each is checked against its own homepage: the site has to call itself by the name you asked for. Parked and for-sale domains never pass. It takes a few seconds, and the verified answer is added to the index, so the next lookup of that name is instant.
Example requests
curl "https://api.prefetch.io/resolve?name=Delta" \
-H "X-API-Key: $PREFETCH_API_KEY"
curl "https://api.prefetch.io/resolve?name=Linear&live=true" \
-H "X-API-Key: $PREFETCH_API_KEY"
const params = new URLSearchParams({ name: "Delta", live: "true" });
const res = await fetch(`https://api.prefetch.io/resolve?${params}`, {
headers: { "X-API-Key": process.env.PREFETCH_API_KEY },
});
const { data } = await res.json();
const [best] = data.results;
if (best && best.confidence >= 0.8) {
console.log(`${data.query} โ ${best.domain}`);
} else {
console.log("No confident answer; candidates:", data.results.map((r) => r.domain));
}
import requests, os
r = requests.get(
"https://api.prefetch.io/resolve",
params={"name": "Delta", "live": "true"},
headers={"X-API-Key": os.environ["PREFETCH_API_KEY"]},
)
results = r.json()["data"]["results"]
if results and results[0]["confidence"] >= 0.8:
print(results[0]["domain"])
Example response
{
"success": true,
"data": {
"query": "Delta",
"results": [
{ "name": "Delta Air Lines", "domain": "delta.com", "url": "https://delta.com", "confidence": 0.92, "source": "index" },
{ "name": "DELTA", "domain": "delta.nl", "url": "https://delta.nl", "confidence": 0.79, "source": "index" },
{ "name": "Delta Holding", "domain": "deltaholding.rs", "url": "https://deltaholding.rs", "confidence": 0.79, "source": "index" }
],
"count": 3,
"live_used": false,
"warnings": []
},
"meta": {
"requestId": "b4e3d2c1-8a7b-4c3d-9e2f-1a3b5c7d9e1f",
"durationMs": 41
}
}
Reading the response
| Field | Meaning |
|---|---|
results[0].confidence | 0.8 or above: this is the answer. Below: a candidate โ check it, or retry with live=true. |
source | curated (reviewed brand data), index (the name index), or live (verified against the site during this request). |
domain | A bare host, ready for the url parameter of /enrich, /brand, /company and the rest. |
live_used | Whether the live lookup ran โ and so whether you were billed 3 credits. |
warnings | Non-fatal notes. If the live lookup could not run (the service was busy, for example) you get the indexโs answer, billed at the index price, and a warning saying so. |
200 with an empty results list.
Credits
| Outcome | Credits |
|---|---|
| Answered from the index | 1 |
Nothing matched (without live) | 0 |
live=true and the live lookup ran | 3 โ whether or not it found anything |
live=true, but the index was already confident | 1 |
Typeahead
/resolve also completes partial names โ stri returns Stripe first โ which makes it usable behind a search box. Completions are always below 0.8: they are suggestions, not answers. Leave live off for typeahead, and debounce keystrokes: each request counts against your rate limit.
Related
GET /enrich
Everything about the company behind the domain you just found. 12 credits.
GET /brand
Colors, fonts and logos for it. 10 credits.
Authorizations
Your Prefetch API key. Obtain one from the dashboard.
Query Parameters
The company, brand or product name (1โ100 characters). Case, accents, punctuation and legal suffixes are ignored: "The Coca-Cola Company" and "coca cola" are the same query.
Required string length:
1 - 100Maximum number of results.
Required range:
1 <= x <= 10When no answer reaches 0.8, look the name up live: candidate domains are verified against their own homepages. Takes a few seconds; billed 3 credits when the live lookup runs.