Expand description
Official Rust SDK for the Refyne API.
Refyne is an LLM-powered web extraction API that transforms unstructured websites into clean, typed data.
§Quick Start
use refyne::{Client, ExtractRequest};
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), refyne::Error> {
let client = Client::builder("your-api-key").build()?;
let result = client.extract(ExtractRequest {
url: "https://example.com/product".into(),
schema: json!({
"name": "string",
"price": "number",
}),
..Default::default()
}).await?;
println!("{:?}", result.data);
Ok(())
}Structs§
- APIKey
Response - Admin
JobResults Output Body - Analysis
Result Input - Analysis
Result Output - Analytics
JobResponse - Analyze
Input Body - Analyze
Response Body - Cache
Entry - A cached entry.
- Cleaner
Chain Item Response - Cleaner
Config Input - Cleaner
Option Response - Cleaner
Options Input - Cleaner
Response - Client
- The main Refyne SDK client.
- Client
Builder - Builder for constructing a
Client. - Crawl
Inline Webhook Input - Crawl
JobResponse Body - Crawl
MapEntry - Crawl
Options - Crawl
Options Input - Crawl
Options Output - Crawl
Webhook Header Input - Create
Crawl JobInput Body - Create
KeyInput Body - Create
KeyOutput Body - Create
Platform Schema Input Body - Create
Saved Site Input Body - Create
Schema Input Body - Debug
Capture Entry - Debug
CaptureLLM Request - Debug
CaptureLLM Response - Delete
Saved Site Output Body - Delete
Schema Output Body - Delete
Service KeyOutput Body - Delete
User Service KeyOutput Body - Delete
Webhook Output Body - Detected
Element Input - Detected
Element Output - Error
Category Response - Error
Detail - Error
Model - Error
Summary - Extract
Input Body - Extract
Output Body - FailingURL
Response - Fallback
Chain Entry Input - Fallback
Chain Entry Response - Follow
Pattern Input - Follow
Pattern Output - GetAnalytics
Jobs Output Body - GetAnalytics
Users Output Body - GetCrawl
MapOutput Body - GetErrors
Output Body - GetFallback
Chain Output Body - GetJob
Debug Capture Output Body - GetJob
Results Download Output Body - GetJob
Webhook Deliveries Output Body - GetTrends
Output Body - GetUsage
Output Body - GetUser
Fallback Chain Output Body - Health
Check Output Body - Inline
Webhook Input - JobCleaner
Config Input - JobCleaner
Options Input - JobResponse
- JobWebhook
Delivery Response - Jobs
Client - Sub-client for job-related operations.
- Keys
Client - Sub-client for API key operations.
- LLMConfig
Input - List
AllSchemas Output Body - List
Cleaners Output Body - List
Jobs Output Body - List
Keys Output Body - List
Models Output Body - List
Providers Output Body - List
Saved Sites Output Body - List
Schemas Output Body - List
Service Keys Output Body - List
Tier Limits Output Body - List
Tiers Output Body - List
User Service Keys Output Body - List
Webhook Deliveries Output Body - List
Webhooks Output Body - Livez
Output Body - LlmClient
- Sub-client for LLM configuration.
- Memory
Cache - In-memory cache implementation with O(1) eviction.
- Metadata
Response - Model
- Available LLM model.
- Model
Validation Request - Model
Validation Response - Overview
Response - Provider
Error Response - Provider
Info - Provider
Model Response - Providers
Response - Response containing available LLM providers.
- Readyz
Output Body - Revoke
KeyOutput Body - SSEComplete
Event - SSEError
Event - SSEResult
Event - SSEStatus
Event - Saved
Site Output - Schema
Output - Schemas
Client - Sub-client for schema operations.
- Service
KeyInput - Service
KeyResponse - SetFallback
Chain Input Body - SetFallback
Chain Output Body - SetUser
Fallback Chain Input Body - SetUser
Fallback Chain Output Body - Sites
Client - Sub-client for site operations.
- Subscription
Tier Response - Sync
Tiers Output Body - Tier
Limits Response - Tier
Validation Request - Tier
Validation Response - Token
Usage - Trend
Point Response - Update
Saved Site Input Body - Update
Schema Input Body - Usage
Response - User
Fallback Chain Entry Input - User
Fallback Chain Entry Response - User
List Models Output Body - User
Model Response - User
Service KeyInput - User
Service KeyResponse - User
Summary Response - Validate
Models Input Body - Validate
Models Output Body - Validate
Tiers Input Body - Validate
Tiers Output Body - Webhook
Delivery Response - Webhook
Header Input - Webhook
Input - Webhook
Response
Enums§
- Analyze
Input Body Fetch Mode - Cleaner
Options Input Output - Cleaner
Options Input Preset - Create
Saved Site Input Body Fetch Mode - Create
Schema Input Body Visibility - Error
- Error types for the Refyne SDK.
- Extract
Input Body Fetch Mode - Fallback
Chain Entry Input Provider - JobCleaner
Options Input Output - JobCleaner
Options Input Preset - LLMConfig
Input Provider - Service
KeyInput Provider - Update
Saved Site Input Body Fetch Mode - Update
Schema Input Body Visibility - User
Fallback Chain Entry Input Provider - User
Service KeyInput Provider
Constants§
- MAX_
KNOWN_ API_ VERSION - Maximum API version this SDK was built against.
- MIN_
API_ VERSION - Minimum API version this SDK supports.
- SDK_
VERSION - Current SDK version.
Traits§
- Cache
- Trait for cache implementations.
Functions§
- check_
api_ version_ compatibility - Check if an API version is compatible with this SDK.
- compare_
versions - Compare two semver versions.
- parse_
version - Parse a semver version string into components.
Type Aliases§
- Analyze
Request - Analyze request.
- Analyze
Response - Analyze response.
- ApiKey
Created - API key creation response.
- ApiKey
List - API key list response.
- Crawl
JobCreated - Crawl job created response.
- Crawl
Request - Crawl request.
- Create
Schema Request - Schema creation request.
- Create
Site Request - Site creation request.
- Extract
Request - Extract request.
- Extract
Response - Extract response.
- Job
- Single job response.
- JobList
- Job list response.
- JobResults
- Job extraction results (dynamic JSON).
- LlmChain
- LLM fallback chain.
- LlmChain
Entry - LLM fallback chain entry.
- LlmKey
- User LLM service key response.
- LlmKey
List - LLM service key list response.
- Model
List - Model list response.
- Result
- Result type for Refyne operations.
- Schema
- Schema response.
- Schema
List - Schema list response.
- Site
- Saved site response.
- Site
List - Saved site list response.
- Upsert
LlmKey Request - LLM key upsert request.