Quick start
1. Get a key
Section titled “1. Get a key”Sign in to the console and make a key. A new account starts with $2 of balance, which is 2,000 searches. The key is shown once, so put it somewhere safe:
export SHINAPI_KEY="shin_..."2. Search
Section titled “2. Search”curl https://api.shinapi.com/v1/search \ -H "Authorization: Bearer $SHINAPI_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "2026年の年収の壁はいくらですか", "max_results": 4}'const response = await fetch("https://api.shinapi.com/v1/search", { method: "POST", headers: { Authorization: `Bearer ${process.env.SHINAPI_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ query: "2026年の年収の壁はいくらですか", max_results: 4 }),});if (!response.ok) throw new Error(await response.text());
const answer = await response.json();if (answer.outcome === "answered") { for (const passage of answer.results) console.log(passage.url, passage.text);}import jsonimport osimport urllib.request
request = urllib.request.Request( "https://api.shinapi.com/v1/search", data=json.dumps({"query": "2026年の年収の壁はいくらですか", "max_results": 4}).encode(), headers={ "Authorization": f"Bearer {os.environ['SHINAPI_KEY']}", "Content-Type": "application/json", },)with urllib.request.urlopen(request) as response: answer = json.load(response)
if answer["outcome"] == "answered": for passage in answer["results"]: print(passage["url"], passage["text"])3. Give it to your model
Section titled “3. Give it to your model”Put the passages in the model’s context and ask it to answer from them alone. Three rules make the answers better:
- Cite
url, and showattributionwherever you show a passage’s text. - Branch on
outcome. Onout_of_scope, ask another search. Onno_match_in_scope, say that the sources do not answer it. Do not let the model fill the gap. - Ask again when
incompleteis true before you conclude that something is not there.
An agent that speaks MCP needs none of this code: see MCP.