Go Client
The Evomi Go Client provides a production-ready, typed interface to Evomi’s API with native Go idioms and full API coverage.
Installation
go get github.com/evomi/evomi-go-clientQuick Start
package main
import (
"context"
"fmt"
"log"
"github.com/evomi/evomi-go-client/evomi"
)
func main() {
client := evomi.NewClient("your-api-key", "", "")
result, err := client.Scrape(context.Background(), "https://example.com", evomi.ScrapeOptions{})
if err != nil {
log.Fatal(err)
}
fmt.Println(result["content"])
}Authentication
Set your API key via environment variable:
export EVOMI_API_KEY="your-api-key"Or pass it directly:
client := evomi.NewClient("your-api-key", "", "")Custom base URL (for testing):
client := evomi.NewClient("your-api-key", "https://custom.evomi.com", "")Scraping Operations
Scrape(ctx, url, opts)
Scrape a single URL with configurable options.
result, err := client.Scrape(ctx, "https://example.com", evomi.ScrapeOptions{
Mode: "auto",
Output: "markdown",
Device: "windows",
ProxyType: "residential",
ProxyCountry: "US",
ProxySessionID: "abc123",
WaitUntil: "domcontentloaded",
AIEnhance: true,
AIPrompt: "Extract product data",
AISource: "markdown",
JSInstructions: []map[string]any{{"click": ".load-more"}},
ExecuteJS: "window.scrollTo(0, document.body.scrollHeight)",
WaitSeconds: 2,
Screenshot: false,
PDF: false,
ExcludedTags: []string{"nav", "footer"},
ExcludedSelectors: []string{".ads"},
BlockResources: []string{"image", "stylesheet"},
AdditionalHeaders: map[string]string{"X-Custom": "value"},
CaptureHeaders: true,
NetworkCapture: []map[string]any{{"url_pattern": "/api/.*"}},
AsyncMode: false,
ConfigID: "cfg_abc123",
SchemeID: "sch_abc123",
ExtractScheme: []map[string]any{{"label": "title", "type": "content", "selector": "h1"}},
StorageID: "stor_abc123",
UseDefaultStorage: false,
NoHTML: false,
})| Field | Type | Default | Description |
|---|---|---|---|
Mode |
string | "auto" |
Scraping mode: "request", "browser", "auto" |
Output |
string | "markdown" |
Output format: "html", "markdown", "screenshot", "pdf" |
Device |
string | "windows" |
Device type: "windows", "macos", "android" |
ProxyType |
string | "residential" |
Proxy type: "datacenter", "residential" |
ProxyCountry |
string | "US" |
Two-letter country code |
ProxySessionID |
string | — | Proxy session ID (6-8 chars) |
WaitUntil |
string | "domcontentloaded" |
Wait condition |
AIEnhance |
bool | false |
Enable AI extraction |
AIPrompt |
string | — | Prompt for AI extraction |
AISource |
string | — | AI source |
AIForceJSON |
bool | true |
Force AI response to JSON |
JSInstructions |
[]map[string]any |
— | JS actions |
ExecuteJS |
string | — | Raw JavaScript to execute |
WaitSeconds |
int | 0 |
Seconds to wait after page load |
Screenshot |
bool | false |
Capture screenshot |
PDF |
bool | false |
Capture PDF |
ExcludedTags |
[]string |
— | HTML tags to remove |
ExcludedSelectors |
[]string |
— | CSS selectors to remove |
BlockResources |
[]string |
— | Resource types to block |
AdditionalHeaders |
map[string]string |
— | Extra HTTP headers |
CaptureHeaders |
bool | false |
Capture response headers |
NetworkCapture |
[]map[string]any |
— | Network capture filters |
AsyncMode |
bool | false |
Return immediately with task ID |
ConfigID |
string | — | Saved config ID |
SchemeID |
string | — | Saved extraction schema ID |
ExtractScheme |
[]map[string]any |
— | Inline extraction schema |
StorageID |
string | — | Storage config ID |
UseDefaultStorage |
bool | false |
Use default storage |
NoHTML |
bool | false |
Exclude HTML from response |
Crawl(ctx, domain, opts)
Crawl a website to discover and scrape multiple pages.
result, err := client.Crawl(ctx, "example.com", evomi.CrawlOptions{
MaxURLs: 100,
Depth: 2,
URLPattern: "/blog/.*",
ScraperConfig: map[string]any{"mode": "browser", "output": "markdown"},
AsyncMode: false,
})| Field | Type | Default | Description |
|---|---|---|---|
MaxURLs |
int | 100 |
Maximum URLs to crawl |
Depth |
int | 2 |
Crawl depth |
URLPattern |
string | — | Regex pattern to filter URLs |
ScraperConfig |
map[string]any |
— | Config for scraping each page |
AsyncMode |
bool | false |
Return immediately with task ID |
MapWebsite(ctx, domain, opts)
Discover URLs from a website via sitemaps, CommonCrawl, or crawling.
result, err := client.MapWebsite(ctx, "example.com", evomi.MapOptions{
Sources: []string{"sitemap", "commoncrawl"},
MaxURLs: 500,
URLPattern: "/products/.*",
CheckIfLive: false,
Depth: 1,
AsyncMode: false,
})| Field | Type | Default | Description |
|---|---|---|---|
Sources |
[]string |
["sitemap", "commoncrawl"] |
Discovery sources |
MaxURLs |
int | 500 |
Maximum URLs to discover |
URLPattern |
string | — | Regex pattern to filter URLs |
CheckIfLive |
bool | false |
Check if URLs are live |
Depth |
int | 1 |
Crawl depth if using crawl source |
AsyncMode |
bool | false |
Return immediately with task ID |
SearchDomains(ctx, query, opts)
Find domains by searching the web.
// Single query
result, err := client.SearchDomains(ctx, "e-commerce platforms", evomi.SearchOptions{
MaxURLs: 20,
Region: "us-en",
})
// Multiple queries (up to 10)
result, err := client.SearchDomains(ctx, []string{"web scraping tools", "data extraction"}, evomi.SearchOptions{
MaxURLs: 20,
})| Field | Type | Default | Description |
|---|---|---|---|
MaxURLs |
int | 20 |
Max domains per query (max: 100) |
Region |
string | "us-en" |
Region for results |
AgentRequest(ctx, message)
Send a natural language request to the AI agent.
result, err := client.AgentRequest(ctx, "Scrape example.com and extract all product prices")GetTaskStatus(ctx, taskID, taskType)
Check the status of an async task.
result, err := client.GetTaskStatus(ctx, "abc123", "scrape")
// taskType: "scrape" | "crawl" | "map" | "config_generate" | "schema"
Config Management
Save and reuse scrape configurations.
ListConfigs(ctx, opts)
configs, err := client.ListConfigs(ctx, evomi.ListConfigsOptions{
Page: 1,
PerPage: 20,
SortBy: "created_at",
SortOrder: "desc",
})CreateConfig(ctx, name, config)
config, err := client.CreateConfig(ctx, "Product Scraper", map[string]any{
"mode": "browser",
"output": "markdown",
})GetConfig(ctx, configID)
config, err := client.GetConfig(ctx, "cfg_abc123")UpdateConfig(ctx, configID, name, config)
config, err := client.UpdateConfig(ctx, "cfg_abc123", "New Name", map[string]any{
"mode": "request",
})DeleteConfig(ctx, configID)
result, err := client.DeleteConfig(ctx, "cfg_abc123")GenerateConfig(ctx, name, prompt)
Generate a scrape config from natural language using AI.
config, err := client.GenerateConfig(ctx, "Amazon Scraper",
"Scrape product title and price from Amazon product pages")Schema Management
Define reusable structured data extraction schemas.
ListSchemas(ctx, opts)
schemas, err := client.ListSchemas(ctx, evomi.ListSchemasOptions{
Page: 1,
PerPage: 20,
SortBy: "created_at",
SortOrder: "desc",
})CreateSchema(ctx, name, config, opts)
schema, err := client.CreateSchema(ctx, "Product Schema", map[string]any{
"url": "https://example.com/product",
"extract_scheme": []map[string]any{
{"label": "title", "type": "content", "selector": "h1"},
{"label": "price", "type": "content", "selector": ".price"},
},
}, evomi.CreateSchemaOptions{
Test: true,
Fix: false,
})GetSchema(ctx, schemeID)
schema, err := client.GetSchema(ctx, "sch_abc123")UpdateSchema(ctx, schemeID, name, config, opts)
schema, err := client.UpdateSchema(ctx, "sch_abc123", "Updated Schema",
map[string]any{"url": "...", "extract_scheme": [...]},
evomi.CreateSchemaOptions{Test: true})DeleteSchema(ctx, schemeID)
result, err := client.DeleteSchema(ctx, "sch_abc123")GetSchemaStatus(ctx, schemeID)
status, err := client.GetSchemaStatus(ctx, "sch_abc123")Schedule Management
Run scrape configs on a recurring schedule.
ListSchedules(ctx, opts)
schedules, err := client.ListSchedules(ctx, evomi.ListSchedulesOptions{
Page: 1,
PerPage: 20,
ActiveOnly: false,
})CreateSchedule(ctx, name, configID, intervalMinutes, opts)
schedule, err := client.CreateSchedule(ctx, "Daily Price Check", "cfg_abc123", 1440,
evomi.CreateScheduleOptions{
StartTime: "09:00",
StopOnError: true,
})GetSchedule(ctx, scheduleID)
schedule, err := client.GetSchedule(ctx, "sched_abc123")UpdateSchedule(ctx, scheduleID, opts)
schedule, err := client.UpdateSchedule(ctx, "sched_abc123", evomi.UpdateScheduleOptions{
Name: "New Name",
IntervalMinutes: 720,
})DeleteSchedule(ctx, scheduleID)
result, err := client.DeleteSchedule(ctx, "sched_abc123")ToggleSchedule(ctx, scheduleID)
result, err := client.ToggleSchedule(ctx, "sched_abc123")ListScheduleRuns(ctx, scheduleID, opts)
runs, err := client.ListScheduleRuns(ctx, "sched_abc123", evomi.ListScheduleRunsOptions{
Page: 1,
PerPage: 20,
})Storage Management
Connect cloud storage to automatically save scrape results.
ListStorageConfigs(ctx)
configs, err := client.ListStorageConfigs(ctx)CreateStorageConfig(ctx, name, storageType, config, setAsDefault)
// S3-compatible storage
storage, err := client.CreateStorageConfig(ctx, "My S3", "s3_compatible", map[string]any{
"bucket": "my-bucket",
"region": "us-east-1",
"access_key": "...",
"secret_key": "...",
}, true)
// Google Cloud Storage
storage, err := client.CreateStorageConfig(ctx, "My GCS", "gcs", map[string]any{
"bucket": "my-bucket",
"credentials_json": "...",
}, false)
// Azure Blob Storage
storage, err := client.CreateStorageConfig(ctx, "My Azure", "azure_blob", map[string]any{
"container": "my-container",
"connection_string": "...",
}, false)UpdateStorageConfig(ctx, storageID, opts)
setAsDefault := true
storage, err := client.UpdateStorageConfig(ctx, "stor_abc123", evomi.UpdateStorageOptions{
Name: "Renamed Storage",
SetAsDefault: &setAsDefault,
})DeleteStorageConfig(ctx, storageID)
result, err := client.DeleteStorageConfig(ctx, "stor_abc123")Public API
Access proxy credentials and related data.
GetProxyData(ctx)
Get detailed information about your proxy products.
data, err := client.GetProxyData(ctx)
// Returns: {"products": {"rp": {...}, "sdc": {...}, "mp": {...}}, ...}
GetTargetingOptions(ctx)
Get available targeting parameters for different proxy types.
options, err := client.GetTargetingOptions(ctx)GetScraperData(ctx)
Get information about your Scraper API access.
data, err := client.GetScraperData(ctx)GetBrowserData(ctx)
Get information about your Browser API access.
data, err := client.GetBrowserData(ctx)RotateSession(ctx, sessionID, product)
Force an IP address change for an existing proxy session.
result, err := client.RotateSession(ctx, "abc12345", "rp")
// product: "rpc", "rp", "sdc", "mp"
GenerateProxies(ctx, product, opts)
Generate proxy strings with specific targeting parameters.
adblock := true
prependProtocol := true
proxies, err := client.GenerateProxies(ctx, "rp", evomi.GenerateProxiesOptions{
Countries: "US,GB,DE",
City: "New York",
Session: "sticky",
Amount: 10,
Protocol: "http",
Lifetime: 30,
Adblock: &adblock,
PrependProtocol: &prependProtocol,
})
// Returns plain text, one proxy per line
Account Info
GetAccountInfo(ctx)
info, err := client.GetAccountInfo(ctx)
fmt.Println(info["credits_remaining"])Proxy String Builder
Evomi provides a proxy network you can use with any HTTP client. Build proxy strings for Go’s http.Client or any other library:
client := evomi.NewClient("your-api-key", "", "")
proxyString, err := client.BuildProxyString(ctx, evomi.ProxyTypeResidential, struct {
Country string
Session string
}{
Country: "US",
Session: "abc12345",
})
fmt.Println(proxyString)
// Output: http://user:[email protected]:1000
Manual Proxy Configuration
config := &evomi.ProxyConfig{
ProxyType: evomi.ProxyTypeResidential,
Protocol: evomi.ProxyProtocolHTTP,
Country: "US",
City: "New York",
Username: "your-username",
Password: "your-password",
}
proxyString := config.BuildProxyString()Proxy Types
| Type | Endpoint | Use Case |
|---|---|---|
| Residential | rp.evomi.com:1000 |
Human-like browsing, anti-bot bypass |
| Datacenter | dcp.evomi.com:2000 |
Fast, high-volume requests |
| Mobile | mp.evomi.com:3000 |
Highest trust, mobile-specific targets |
Error Handling
result, err := client.Scrape(ctx, "https://example.com", evomi.ScrapeOptions{})
if err != nil {
log.Fatal(err)
}
if success, ok := result["success"].(bool); !ok || !success {
fmt.Println("API error:", result["error"])
}Credits & Pricing
All operations consume credits:
| Operation | Cost |
|---|---|
| Base request | 1 credit |
| Browser mode | 5x multiplier |
| Residential proxy | 2x multiplier |
| AI enhancement | +30 credits |
| Screenshot/PDF | +1 credit each |
Credit usage is returned in the result:
fmt.Println(result["_credits_used"])
fmt.Println(result["_credits_remaining"])Requirements
- Go 1.21+
Resources
| Resource | Link |
|---|---|
| GitHub Repository | github.com/evomi/evomi-go-client |
| Evomi Website | evomi.com |
| API Documentation | docs.evomi.com |
Benefits
- Native Go — Idiomatic Go with typed structs and comprehensive endpoint support
- Full API Coverage — All Evomi endpoints supported
- Strong Typing — Typed structs for configuration and requests