SDKs & Libraries
Official SDKs for all major programming languages. Get started with web parsing in minutes.
Python SDK
Installation
pip install uneralon
Quick Start
import uneralon
client = uneralon.Client(api_key="YOUR_API_KEY")
# Extract data from a webpage
result = client.extract(
url="https://example.com/products",
selectors={
"title": "h1.product-title",
"price": ".price-value",
"description": ".product-desc"
}
)
print(result.data)
Features
- Async/await support with
asyncio - Pandas DataFrame integration
- Type hints for IDE support
- Retry with exponential backoff
- Comprehensive error handling
Async Example
import asyncio
import uneralon
async def main():
client = uneralon.AsyncClient(api_key="YOUR_API_KEY")
urls = ["https://example.com/1", "https://example.com/2"]
results = await client.batch_extract(urls=urls, selectors=selectors)
for result in results:
print(result.data)
asyncio.run(main())
Node.js SDK
Installation
npm install @uneralon/sdk
Quick Start
import { Uneralon } from '@uneralon/sdk';
const client = new Uneralon({ apiKey: 'YOUR_API_KEY' });
const result = await client.extract({
url: 'https://example.com/products',
selectors: {
title: 'h1.product-title',
price: '.price-value',
description: '.product-desc'
}
});
console.log(result.data);
Features
- Full TypeScript support
- Promise-based API
- Automatic retry logic
- Stream support for large responses
- ESM and CommonJS compatible
Batch Processing
const results = await client.batchExtract({
urls: ['https://example.com/1', 'https://example.com/2'],
selectors: selectors,
concurrency: 10
});
results.forEach(result => console.log(result.data));
Go SDK
Installation
go get github.com/uneralon/uneralon-go
Quick Start
package main
import (
"fmt"
"github.com/uneralon/uneralon-go"
)
func main() {
client := uneralon.NewClient("YOUR_API_KEY")
result, err := client.Extract(uneralon.ExtractRequest{
URL: "https://example.com/products",
Selectors: map[string]string{
"title": "h1.product-title",
"price": ".price-value",
},
})
if err != nil {
panic(err)
}
fmt.Println(result.Data)
}
Features
- Context support for cancellation
- Concurrent batch processing
- Structured error types
- Connection pooling
- Zero external dependencies
Java SDK
Installation (Maven)
<dependency>
<groupId>com.uneralon</groupId>
<artifactId>uneralon-java</artifactId>
<version>1.0.0</version>
</dependency>
Quick Start
import com.uneralon.Uneralon;
import com.uneralon.ExtractResult;
Uneralon client = new Uneralon.Builder()
.apiKey("YOUR_API_KEY")
.build();
Map<String, String> selectors = Map.of(
"title", "h1.product-title",
"price", ".price-value"
);
ExtractResult result = client.extract("https://example.com", selectors);
System.out.println(result.getData());
Features
- Builder pattern for configuration
- CompletableFuture for async
- Spring Boot integration
- Comprehensive JavaDocs
- Gradle and Maven support
PHP SDK
Installation
composer require uneralon/uneralon-php
Quick Start
<?php
require 'vendor/autoload.php';
use Uneralon\Client;
$client = new Client('YOUR_API_KEY');
$result = $client->extract([
'url' => 'https://example.com/products',
'selectors' => [
'title' => 'h1.product-title',
'price' => '.price-value'
]
]);
print_r($result->data);
Features
- PSR-18 HTTP client support
- Laravel integration
- Guzzle-based HTTP
- Array and object responses
- Comprehensive exceptions
SDK Comparison
| Feature | Python | Node.js | Go | Java | PHP |
|---|---|---|---|---|---|
| Async Support | Yes | Yes | Yes | Yes | No |
| Batch Processing | Yes | Yes | Yes | Yes | Yes |
| Type Safety | Hints | TypeScript | Native | Native | PHPStan |
| Retry Logic | Built-in | Built-in | Built-in | Built-in | Built-in |
| Streaming | Yes | Yes | Yes | Yes | No |
Configuration Options
All SDKs support these configuration options:
| Option | Default | Description |
|---|---|---|
api_key | Required | Your API key |
base_url | api.uneralon.com | API endpoint |
timeout | 30000 | Request timeout (ms) |
retry_count | 3 | Max retry attempts |
proxy | null | Custom proxy for SDK requests |
Error Handling
All SDKs provide structured error types:
# Python example
try:
result = client.extract(url, selectors)
except uneralon.AuthenticationError:
# Invalid API key
except uneralon.RateLimitError as e:
# Rate limit exceeded, retry after e.retry_after
except uneralon.ExtractionError as e:
# Extraction failed, check e.message
except uneralon.NetworkError:
# Network connectivity issue
Community SDKs
- Ruby:
gem install uneralon - Rust:
cargo add uneralon - C#:
dotnet add package Uneralon
Need a different language? Request an SDK or contact support.