Search in plain English
View as MarkdownPOST /v1/search. One sentence in, a ranked shortlist out, with the evidence behind every pick. Blocking or streamed as server-sent events.
Describe who you are looking for in a sentence and get back a ranked shortlist of real people, with the evidence behind every pick. This is the search the product is built around, unchanged and unabridged.
/api/v1/search100 creditsOne sentence in, a ranked shortlist out. Blocking by default, or streamed as server-sent events.
querystringoptional- One sentence describing who you want. Include the constraints that matter: role, seniority, location, what they have built. Naming a count is honoured. Use this or
messages. messagesarrayoptional- A conversation of
{ role, content }objects, for follow-ups. Roles areuserandassistant. Use this orquery. streambooleanoptional- Return server-sent events instead of one JSON body. Defaults to
false. rerankbooleanoptional- Rank and trim to a shortlist. Defaults to
true. Setfalseto get every unique person the sources returned, unranked.
curl https://www.refolk.ai/api/v1/search \
-H "Authorization: Bearer $REFOLK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "Series A fintech CTOs in London who came from a bank"}'Follow-ups
Pass the conversation back and the second question is read in the light of the first, exactly as it is in the app.
{
"messages": [
{ "role": "user", "content": "Founders of seed-stage fintechs in London" },
{ "role": "assistant", "content": "Found 25." },
{ "role": "user", "content": "Only the ones who were engineers first" }
]
}Fifty messages and a hundred thousand characters are the ceiling. Past either, start a new conversation: the whole history is read on every turn, so a long one is paid for again each time.
The response
answerstringrequired- A short written summary of the run.
peoplearrayrequired- The shortlist. Each carries a
name, a stablekey, whatever role and location resolved, areasonfor the match (one sentence, written once the list is ranked), andsignals, which is the evidence behind it. companiesarrayrequired- Populated when the question was about companies instead. A query about fintechs in Berlin returns these.
companiesNextstring | nullrequired- When more companies match than came back, the continuation for the next page. Pass it to
POST /api/v1/companies/more.nullwhen there is no next page. When the run searched companies more than once, it is the list with the most left. companiesMorearrayrequired- One continuation per company search that still has a page left, most companies left first:
next, alabelsaying what that search asked for,remainingandtotalCount. Page whichever list you meant. reposarrayrequired- Populated when the question was about repositories.
noMatchobject | nullrequirednullunless nobody in the index met the ask. Thenpeopleis empty, nothing is charged, and it carriesaskedFor(the ask as I read it),found(what came close, or an empty string) andsuggestions(re-asks that would return people, ready to send as the nextquery).creditsobjectrequiredchargedandbalancefor this run.
An empty list always comes with a reason. When noMatch is set, nobody met
the ask and I would rather say so than hand back a broader list that reads like
the one you asked for:
{
"answer": "",
"people": [],
"companies": [],
"repos": [],
"noMatch": {
"askedFor": "Rust maintainers who studied at IIT Ropar",
"found": "Several IIT Ropar alumni work in systems programming, none with Rust on file.",
"suggestions": ["IIT Ropar alumni working on systems software"]
},
"credits": { "charged": 0, "balance": 480 }
}Profile photos come back as absolute URLs on this site rather than wherever the image is hosted, so they can be rendered anywhere without leaking where they came from.
Streaming
A search takes tens of seconds. If something with a screen is waiting on it,
stream it: one JSON object per data: line, in the order things happened.
const res = await fetch("https://www.refolk.ai/api/v1/search", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.REFOLK_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ query: "Rust maintainers in Europe", stream: true }),
});
const reader = res.body!.pipeThrough(new TextDecoderStream()).getReader();
let buffer = "";
while (true) {
const { value, done } = await reader.read();
if (done) break;
buffer += value;
const lines = buffer.split("\n\n");
buffer = lines.pop() ?? "";
for (const line of lines) {
if (!line.startsWith("data: ")) continue;
const event = JSON.parse(line.slice(6));
if (event.type === "people") console.log(event.people.length, "found");
}
}The event types, in the order you will meet them:
| Type | Meaning |
|---|---|
step | A stage of the search started. |
step_done | It finished, with durationMs, and error if it failed. |
token | A fragment of the written answer. |
people_partial | What one source found, before the merge. Superseded by people. |
people, companies, repos | The results. A companies event carries next and more, the same continuations as companiesNext and companiesMore. |
blurb | The reason for one ranked person, as key and text, after people. The blocking body has these filled in already. |
no_match | Nobody met the ask. Carries askedFor, found and suggestions, the same fields as noMatch above, and ends the run in place of people. |
balance | What the run cost, once it has settled. |
done | The run finished. |
error | The run failed, with a message. |
More companies
A company search hands back at most a hundred companies at a time. When more
match, the response carries companiesNext. Pass it here for the next page,
and pass the next that page returns for the one after it. No model runs.
/api/v1/companies/more8 creditsThe next page of a company list, from the continuation the last page left. An empty page costs nothing.
{ "next": "cp_..." }companiesarrayrequired- The next page, in the order the index returned them.
totalCountnumber | nullrequired- The index's own estimate of how many companies match the search.
nextstring | nullrequired- The continuation for the page after this one, or
nullon the last page. remainingnumber | nullrequired- Companies this list has not returned yet, when the index said how many.
creditsobjectrequiredchargedandbalancefor this page.
A continuation lasts a week and belongs to the key's account. An older one, one
from another account, or one whose list has run out is refused with a 409
before anything is charged; run the search again to get a fresh one.
How long to wait
Thirty to ninety seconds is normal, and a hard search can take longer. Set the
client timeout at three minutes or more. Two searches per key may run at once;
a third is refused with a 429 rather than queued.
Try it on the search you came here for
Stop building boolean strings. Just describe the person.
Type one sentence. I plan the search, read GitHub, public LinkedIn and Crunchbase records, and the open web as it is right now, and hand back a ranked list with the reason next to every name.
01Describe them
One plain sentence. Role, city, stack, stage, whatever matters to you.
02I read the web live
GitHub, public LinkedIn and Crunchbase records, the open web. Not a database that went stale last quarter.
03You read the shortlist
Ranked, with the reasoning under every name. Open a profile, ask a follow-up, narrow it down.
- Staff backend engineers in NYC who shipped Rust in production
- Series A fintechs in SF under 50 people, growing headcount this year
- Maintainers of fast-growing Rust web frameworks on GitHub
- No boolean, no filters, no seat to buy. One box.
- Read at search time, so a profile updated yesterday counts today.
- Every step visible as it runs, every name with its reason.
500 free credits on sign-up. No card, no demo call. See real searches.