# Quick Start

Two steps to plug AI-grade search into your app: grab an API key from the dashboard (or skip it and try the free anonymous tier), then fire your first search request.

API Base URL: `https://api.cn.anysearch.com`

### Anonymous request (per-IP free quota)

```bash
# Note: AI agents handle tag and params routing automatically via MCP or Skill. For direct API usage, select appropriate tag and params for your use case to achieve optimal results.

curl -X POST https://api.cn.anysearch.com/v1/search \
  -H "Content-Type: application/json" \
  -d '{
    "query": "Go 1.26 release notes",
    "max_results": 10
   }'
```

### Authenticated request (with API key)

```bash
# Note: AI agents handle tag and params routing automatically via MCP or Skill. For direct API usage, select appropriate tag and params for your use case to achieve optimal results.

curl -X POST https://api.cn.anysearch.com/v1/search \
  -H "Authorization: Bearer YOUR_ANYSEARCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "Go 1.26 release notes",
    "tag": "code.doc",
    "params": {"library": "golang"},
    "max_results": 10
  }'
```

Replace `YOUR_ANYSEARCH_API_KEY` with your actual API key. You can create one for free at the console.

## Success response

Response excerpt · 1 result · `HTTP 200`

### Success response · application/json

```json
{
  "code": 0,
  "message": "success",
  "request_id": "<SEARCH_REQUEST_ID>",
  "data": {
    "results": [
      {
        "title": "Go 1.26 Release Notes",
        "url": "https://go.dev/doc/go1.26",
        "snippet": "The latest Go release, version 1.26, arrives in February 2026 ..."
      }
    ],
    "metadata": {
      "total_results": 3,
      "search_time_ms": 4038
    }
  }
}
```

**How do I know it worked?**

The call succeeded when the HTTP status is `200` and `code == 0`. In this example, `message` is `"success"`.

No results can still be a success: `results: []` and `total_results: 0` mean the search completed but returned no results.

### How to read a failed call?

On failure, check the HTTP status, `code` and `message`. Keep the actual `request_id` for troubleshooting.

### Failure example · HTTP 401

```json
{
  "code": -1,
  "message": "Invalid API key.",
  "request_id": "<ERROR_REQUEST_ID>",
  "error_code": "invalid_api_key"
}
```

For details, see [Search · Error codes →](/docs/api-endpoints/v1-search#errors)

[View the complete call example →](/docs/api-endpoints#end-to-end-example)

<!-- docs-navigation -->

## Documentation navigation

- [Source](https://www.cn.anysearch.com/docs/quick-start)
- Index: [Docs index](https://www.cn.anysearch.com/docs.md)
- Previous: [Authentication](https://www.cn.anysearch.com/docs/auth.md)
- Next: [API Endpoints](https://www.cn.anysearch.com/docs/api-endpoints.md)
