Oblien.SearchAgent 1.0.0

dotnet add package Oblien.SearchAgent --version 1.0.0
                    
NuGet\Install-Package Oblien.SearchAgent -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Oblien.SearchAgent" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Oblien.SearchAgent" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Oblien.SearchAgent" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Oblien.SearchAgent --version 1.0.0
                    
#r "nuget: Oblien.SearchAgent, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Oblien.SearchAgent@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Oblien.SearchAgent&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Oblien.SearchAgent&version=1.0.0
                    
Install as a Cake Tool

Oblien.SearchAgent - Official .NET Client

A clean, production-ready .NET client library for the Oblien Search API. Provides AI-powered web search, intelligent content extraction, and deep website research with real-time streaming capabilities.

NuGet License: MIT

Features

  • AI-Powered Search - Get relevant web results with optional AI-generated answers
  • Smart Extraction - Extract specific content from web pages using natural language
  • Deep Research - Crawl and analyze websites with real-time Server-Sent Events (SSE) streaming
  • Batch Processing - Process multiple queries or pages simultaneously
  • Flexible Authentication - Support for both Client ID/Secret and Bearer token (JWT)
  • Clean Architecture - Well-structured, production-ready code with proper error handling
  • High Performance - Async/await patterns throughout for optimal performance

Installation

Install via NuGet Package Manager:

dotnet add package Oblien.SearchAgent

Or via Package Manager Console:

Install-Package Oblien.SearchAgent

Or add directly to your .csproj:

<PackageReference Include="Oblien.SearchAgent" Version="1.0.0" />

Quick Start

Using Client ID and Secret

using SearchAgent;
using SearchAgent.Models;

var client = new SearchClient(new SearchClientConfig
{
    ClientId = "your_client_id",
    ClientSecret = "your_client_secret"
});

var results = await client.SearchAsync(
    new[] { "What is TypeScript?" },
    new SearchOptions
    {
        MaxResults = 5,
        IncludeAnswers = true,
        SummaryLevel = "intelligent"
    }
);

foreach (var result in results)
{
    Console.WriteLine($"Query: {result.Query}");
    Console.WriteLine($"Answer: {result.Answer}");
    foreach (var item in result.Results)
    {
        Console.WriteLine($"  - {item.Title}");
        Console.WriteLine($"    {item.Url}");
    }
}

Using Bearer Token

using SearchAgent;
using SearchAgent.Models;

var client = new SearchClient(new SearchClientConfig
{
    BearerToken = "your_jwt_token"
});

var results = await client.SearchAsync(
    new[] { "What is TypeScript?" },
    new SearchOptions
    {
        MaxResults = 5,
        IncludeAnswers = true,
        SummaryLevel = "intelligent"
    }
);

API Methods

Task<List<SearchResult>> SearchAsync(
    string[] queries,
    SearchOptions? options = null,
    CancellationToken cancellationToken = default
)

Search the web with AI-powered answers.

Options:

  • IncludeAnswers - Generate AI answers
  • SummaryLevel - Quality: 'low', 'medium', 'intelligent'
  • MaxResults - Maximum results per query
  • Language - Language code (e.g., 'en', 'es')
  • Region - Region code (e.g., 'us', 'uk')
  • Freshness - Result freshness: 'day', 'week', 'month', 'year'
  • IncludeDomains / ExcludeDomains - Domain filtering
  • SearchTopic - Topic: 'general', 'news', 'finance'
  • SearchDepth - Depth: 'basic', 'advanced'

Extract

Task<ExtractResult> ExtractAsync(
    ExtractPage[] pages,
    ExtractOptions? options = null,
    CancellationToken cancellationToken = default
)

Extract specific content from web pages using natural language instructions.

Example:

var extractResult = await client.ExtractAsync(
    new[]
    {
        new ExtractPage
        {
            Url = "https://example.com/article",
            Details = new[] { "Extract the title", "Extract the author" },
            SummaryLevel = "medium"
        }
    },
    new ExtractOptions
    {
        Format = "markdown",
        Timeout = 30000
    }
);

Options:

  • Format - Output format: 'markdown', 'html', 'text'
  • ExtractDepth - Depth: 'basic', 'advanced'
  • IncludeImages / IncludeFavicon - Include images/favicon
  • MaxContentLength - Maximum content length
  • Timeout - Request timeout in milliseconds

Crawl

Task<CrawlResult> CrawlAsync(
    string instructions,
    CrawlOptions? options = null,
    Action<CrawlEvent>? onEvent = null,
    CancellationToken cancellationToken = default
)

Crawl and research websites with real-time streaming updates.

Example:

var crawlResult = await client.CrawlAsync(
    "Research https://example.com and summarize key features",
    new CrawlOptions
    {
        Type = "deep",
        MaxPages = 10,
        Thinking = true
    },
    onEvent: (evt) =>
    {
        Console.WriteLine($"[{evt.Type}] {evt.Data}");
    }
);

Options:

  • Type - Crawl type: 'deep', 'shallow', 'focused'
  • MaxDepth / MaxPages - Crawl limits
  • IncludeExternal - Include external links
  • Thinking - Enable AI thinking process
  • StreamText - Stream text results
  • Format - Output format

Architecture

SearchAgent/
├── Models/
│   ├── SearchOptions.cs
│   ├── SearchResult.cs
│   ├── ExtractOptions.cs
│   ├── ExtractPage.cs
│   ├── ExtractResult.cs
│   ├── CrawlOptions.cs
│   ├── CrawlResult.cs
│   └── CrawlEvent.cs
├── SearchClient.cs
└── SearchClientConfig.cs

Testing

Run the test application with Client ID/Secret:

cd tests/SearchAgent.Tests
dotnet run

Test with Bearer Token:

cd tests/SearchAgent.Tests
dotnet run -- --bearer "your_jwt_token"

Authentication

The client supports two authentication methods:

1. Client ID and Secret (Header-based)

Best for server-to-server communication:

var client = new SearchClient(new SearchClientConfig
{
    ClientId = "oblien_...",
    ClientSecret = "sk_..."
});

Get your credentials from the Oblien Dashboard.

2. Bearer Token (JWT-based)

Required for Crawl API with SSE streaming:

var client = new SearchClient(new SearchClientConfig
{
    BearerToken = "eyJhbGc..."
});

Important: The Crawl API endpoint requires Bearer token authentication for real-time SSE streaming to work properly.

Requirements

  • .NET 8.0 or higher
  • Oblien API credentials (Client ID and Secret)

License

This is a client library for the Oblien Search API. Refer to Oblien's terms of service for API usage.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 185 11/1/2025