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

# Web Search

> Give your agent real-time access to the entire web with uniskill_search.

## Overview

The `uniskill_search` skill allows your agent to retrieve the latest information from the internet. It is specifically optimized to filter out ads and irrelevant noise, returning only high-value structured data optimized for Large Language Models (LLMs).

### Credit Cost

* **Cost**: 10 credits per call.
* **Rollover**: Unused credits from your subscription rollover indefinitely.

***

## Input Parameters

| Parameter   | Type   | Required | Description                                                |
| :---------- | :----- | :------- | :--------------------------------------------------------- |
| `query`     | string | Yes      | The search query string.                                   |
| `count`     | number | No       | Number of results to return (Default: 5, Max: 20).         |
| `freshness` | string | No       | Time range for results: `day`, `week`, `month`, or `year`. |

***

## Response Headers

Every request to the UniSkill Gateway returns standard headers to help you track your usage and limits:

| Header                  | Description                                              |
| :---------------------- | :------------------------------------------------------- |
| `X-RateLimit-Limit`     | Your maximum allowed requests per minute (RPM).          |
| `X-RateLimit-Remaining` | Remaining requests allowed in the current minute window. |
| `X-UniSkill-Balance`    | Your remaining account credit balance.                   |
| `X-UniSkill-Consumed`   | Credits consumed by the current request.                 |
| `X-UniSkill-Status`     | Operation status (`Success` or `Error`).                 |
| `X-UniSkill-Request-ID` | Unique identifier for debugging and support.             |

***

## Error Handling

| Status Code | Error             | Description                                             |
| :---------- | :---------------- | :------------------------------------------------------ |
| `401`       | Unauthorized      | Invalid or missing API key.                             |
| `402`       | Payment Required  | Insufficient credits to perform the operation.          |
| `429`       | Too Many Requests | Rate limit exceeded for your tier.                      |
| `502`       | Bad Gateway       | Upstream service error (e.g., third-party API timeout). |

***

## Code Examples

<CodeGroup>
  ```python Python theme={null}
  import requests

  # Set your UniSkill API Key
  api_key = "YOUR_UNISKILL_API_KEY"

  def perform_search(query):
      # API endpoint for the search skill
      url = "https://api.uniskill.ai/v1/search"
      
      headers = {
          "Authorization": f"Bearer {api_key}",
          "Content-Type": "application/json"
      }
      
      payload = {
          "query": query,
          "count": 5,
          "freshness": "week"
      }

      # Execute the request and handle the response
      response = requests.post(url, json=payload, headers=headers)
      return response.json()

  results = perform_search("Latest news about AI Agents 2026")
  print(results)
  ```
</CodeGroup>
