Quickstart

Contents
  1. 1. Sign up and create an API key
  2. 2. Send your first request
  3. 3. Read the results
  4. Try it without code

1. Sign up and create an API key

  1. Open the Kuaisou platform and sign up with your mobile number (logging in with an SMS code registers new numbers automatically).
  2. Go to Console · API keys and click Create. API keys start with ks_.
  3. Keep the API key on your server. Never put it in web or app front-end code.

New accounts come with a gift balance, so you can start calling right away. Your balance is on the console home page.

2. Send your first request

Replace YOUR_API_KEY with your API key:

curl -X POST https://platform.kuaisou.com/api/web-search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"Kuaisou","count":10}'

Python

import requests

response = requests.post(
    "https://platform.kuaisou.com/api/web-search",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={"query": "Kuaisou", "count": 10},
    timeout=60,
)
data = response.json()
for page in data["data"][0]["webPages"]["value"]:
    print(page["name"], page["url"])

JavaScript (Node.js 18+)

const response = await fetch("https://platform.kuaisou.com/api/web-search", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ query: "Kuaisou", count: 10 }),
});
const data = await response.json();
for (const page of data.data[0].webPages.value) {
  console.log(page.name, page.url);
}

3. Read the results

On success the HTTP status is 200, code in the body is 200, and the results are in data[0].webPages.value. Each result has a title name, a link url and a snippet snippet. See Web Search for every field.

On failure, check code and msg — see Errors. Failed calls are free.

Try it without code

The console has a Playground: pick an API, enter a query or URL, and see the response together with the matching curl command. The Playground does not use your balance and has a daily limit.