> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuralverge.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Run Search

> Run a search request and receive a search result payload.

# Run Search

## Endpoint

`POST /functions/v1/run-search`

## Purpose

Runs a search query and returns a structured search payload.

## Authentication

Required:

`Authorization: Bearer YOUR_ACCESS_TOKEN`

## Request body

### Required fields

| Field | Type | Description |
| - | - | - |
| `query` | `string` | Search query |
| `settings` | `object` | Search settings |

### Common settings

| Field | Type | Description |
| - | - | - |
| `country` | `string` | Search country such as `us` |
| `language` | `string` | Search language such as `en` |
| `max_results` | `number` | Maximum number of results |

## Example request

```bash theme={null}
curl -X POST "https://api.neuralverge.ai/functions/v1/run-search" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "OpenAI pricing",
    "settings": {
      "country": "us",
      "language": "en",
      "max_results": 10
    }
  }'
```

## Example response

```json theme={null}
{
  "session_id": "11111111-1111-1111-1111-111111111111",
  "kind": "search",
  "query": "OpenAI pricing",
  "results": [
    {
      "rank": 1,
      "title": "OpenAI Pricing",
      "url": "https://openai.com/pricing",
      "snippet": "Simple and flexible pricing."
    }
  ],
  "total_points": 5
}
```

## Possible errors

* `400 Bad Request`
* `401 Unauthorized`
* `402 Payment Required`
* `500 Internal Error`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.