Oblien.SearchAgent
1.0.0
dotnet add package Oblien.SearchAgent --version 1.0.0
NuGet\Install-Package Oblien.SearchAgent -Version 1.0.0
<PackageReference Include="Oblien.SearchAgent" Version="1.0.0" />
<PackageVersion Include="Oblien.SearchAgent" Version="1.0.0" />
<PackageReference Include="Oblien.SearchAgent" />
paket add Oblien.SearchAgent --version 1.0.0
#r "nuget: Oblien.SearchAgent, 1.0.0"
#:package Oblien.SearchAgent@1.0.0
#addin nuget:?package=Oblien.SearchAgent&version=1.0.0
#tool nuget:?package=Oblien.SearchAgent&version=1.0.0
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.
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
Search
Task<List<SearchResult>> SearchAsync(
string[] queries,
SearchOptions? options = null,
CancellationToken cancellationToken = default
)
Search the web with AI-powered answers.
Options:
IncludeAnswers- Generate AI answersSummaryLevel- Quality: 'low', 'medium', 'intelligent'MaxResults- Maximum results per queryLanguage- Language code (e.g., 'en', 'es')Region- Region code (e.g., 'us', 'uk')Freshness- Result freshness: 'day', 'week', 'month', 'year'IncludeDomains/ExcludeDomains- Domain filteringSearchTopic- 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/faviconMaxContentLength- Maximum content lengthTimeout- 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 limitsIncludeExternal- Include external linksThinking- Enable AI thinking processStreamText- Stream text resultsFormat- 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 | Versions 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. |
-
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 |