> For clean Markdown of any page on these docs, append `.md` to the page URL
> Full documentation index: https://you.com/docs/llms.txt
> Search over these docs using a free, read-only MCP server (it is the best way to pick the right API(s) for the job and understand how to use them): https://you.com/docs/_mcp/server
> Access web search, web fetch, and deep research tools using our product MCP server: https://api.you.com/mcp (use `/mcp/research` and `/mcp/finance` paths for Research and Finance Research respectively)
> Call live Web Search for free: https://api.you.com/mcp/free
> OpenAPI spec index: https://you.com/docs/openapi.json
> How to authenticate: https://you.com/docs/using-the-api/authentication
> Changelog: https://you.com/docs/changelog
> Full onboarding instructions for agents: https://you.com/SKILL.md

# Eco Search

GET https://ydc-index.io/v1/eco_search

Lightweight search endpoint that is fast and cheap for model training.

Reference: https://you.com/docs/api-reference/search/v1-eco_search

## Authentication

- `X-API-Key` header (required) — A unique API Key is required to authorize API access. [Get your API Key with free credits](https://you.com/platform).

## Request

### Query parameters

- `query` (string, required) — The search query used to retrieve relevant results from the web.
- `offset` (integer, optional, default: 0) — Specifies the zero-based page index for paginating through search results. When `offset` is greater than zero, each page returns up to `10` results. For example, `offset=0` returns the first page and `offset=1` returns the second page. Default is `0`.
- `country` (enum, optional, default: US) — The country that determines the geographical focus of the web results. Defaults to the US market when omitted. Unsupported values fall back to the default.
  - Allowed values: `AR`, `AU`, `AT`, `BE`, `BR`, `CA`, `CL`, `DK`, `FI`, `FR`, `DE`, `GR`, `HK`, `IN`, `ID`, `IT`, `JP`, `KR`, `MY`, `MX`, `NL`, `NZ`, `NO`, `CN`, `PL`, `PT`, `PH`, `RU`, `SA`, `ZA`, `ES`, `SE`, `CH`, `TW`, `TR`, `GB`, `US`
- `language` (enum, optional, default: EN) — The language of the web results (BCP 47 format). Defaults to English when omitted. On its own, `language` changes few results. Set `country` to change the market. Unsupported values fall back to the default.
  - Allowed values: `AR`, `EU`, `BN`, `BG`, `CA`, `ZH-HANS`, `ZH-HANT`, `HR`, `CS`, `DA`, `NL`, `EN`, `EN-GB`, `ET`, `FI`, `FR`, `GL`, `DE`, `EL`, `GU`, `HE`, `HI`, `HU`, `IS`, `IT`, `JA`, `KN`, `KO`, `LV`, `LT`, `MS`, `ML`, `MR`, `NB`, `PL`, `PT-BR`, `PT-PT`, `PA`, `RO`, `RU`, `SR`, `SK`, `SL`, `ES`, `SV`, `TA`, `TE`, `TH`, `TR`, `UK`, `VI`

## Response

### 200

A JSON object containing web search results.

- `results` (EcoSearchResponseResults, optional)
- `metadata` (EcoSearchMetadata, optional)

## Errors

### 401 Unauthorized Error

Unauthorized. Problems with API key.

- `detail` (string, optional) — Error detail message.

### 403 Forbidden Error

Forbidden. API key lacks scope for this path.

- `detail` (string, optional)

### 422 Unprocessable Entity Error

Unprocessable Entity. Invalid request parameter combination.

- `error` (string, optional)

### 500 Internal Server Error

Internal Server Error.

- `detail` (string, optional)

## Types

### EcoSearchResponseResults

- `web` (list of EcoSearchWebResult, optional)

### EcoSearchMetadata

- `search_uuid` (string, optional)
- `query` (string, optional) — The search query used.
- `latency` (double, optional)

### EcoSearchWebResult

- `url` (string, optional) — The URL of the search result.
- `title` (string, optional) — The title of the search result.
- `description` (string, optional) — A brief description/snippet of the search result.
- `snippets` (list of string, optional) — An array of text snippets from the search result. This is just the site description for Eco Search.
- `favicon_url` (string, optional) — The URL of the favicon of the search result's domain.

## Examples

**Response**

```json
{
  "results": {
    "web": [
      {
        "url": "https://you.com",
        "title": "The World's Greatest Search Engine!",
        "description": "Search on YDC",
        "snippets": [
          "string"
        ],
        "favicon_url": "https://someurl.com/favicon"
      }
    ]
  },
  "metadata": {
    "search_uuid": "942ccbdd-7705-4d9c-9d37-4ef386658e90",
    "query": "What are the latest geopolitical updates from India",
    "latency": 0.123
  }
}
```

**SDK Code**

```python
import requests

url = "https://ydc-index.io/v1/eco_search"

querystring = {"query":"What are the latest geopolitical updates from India"}

headers = {"X-API-Key": "<apiKey>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://ydc-index.io/v1/eco_search?query=What+are+the+latest+geopolitical+updates+from+India';
const options = {method: 'GET', headers: {'X-API-Key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://ydc-index.io/v1/eco_search?query=What+are+the+latest+geopolitical+updates+from+India"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-API-Key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://ydc-index.io/v1/eco_search?query=What+are+the+latest+geopolitical+updates+from+India")
  .header("X-API-Key", "<apiKey>")
  .asString();
```

```csharp
using RestSharp;

var client = new RestClient("https://ydc-index.io/v1/eco_search?query=What+are+the+latest+geopolitical+updates+from+India");
var request = new RestRequest(Method.GET);
request.AddHeader("X-API-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-API-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://ydc-index.io/v1/eco_search?query=What+are+the+latest+geopolitical+updates+from+India")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```