Skip to content

Search

Shows how to search the web using Exa's AI-powered search.

This example assumes using Exa; is in scope and apiKey contains your Exa API key.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
using var client = new ExaClient(apiKey);

// Search the web for relevant results using a natural language query.
var response = await client.SearchAsync(
    new AllOf<SearchRequest2, CommonRequest>(
        value1: new SearchRequest2
        {
            Query = "Latest developments in LLM capabilities",
        },
        value2: new CommonRequest { NumResults = 5 }));

var results = response.Results;
Console.WriteLine($"Found {results!.Count} results");

foreach (var result in results)
{
    Console.WriteLine($"  - {result.Result?.Title}: {result.Result?.Url}");
}