vynco

Rust SDK for the VynCo Swiss Corporate Intelligence API. Access 500,000+ Swiss companies from the commercial register with change tracking, sanctions screening, AI-powered risk analysis, network graphs, watchlists, webhooks, and bulk data exports.
Installation
[dependencies]
vynco = "2.0"
For the synchronous (blocking) client:
[dependencies]
vynco = { version = "2.0", features = ["blocking"] }
Quick Start
use vynco::{Client, CompanyListParams};
#[tokio::main]
async fn main() -> Result<(), vynco::VyncoError> {
let client = Client::builder("vc_live_your_api_key").build()?;
let params = CompanyListParams {
search: Some("Novartis".into()),
canton: Some("BS".into()),
..Default::default()
};
let resp = client.companies().list(¶ms).await?;
println!("Found {} companies", resp.data.total);
let company = client.companies().get("CHE-105.805.080").await?;
println!("{}: {:?}", company.data.name, company.data.legal_form);
let screening = client.screening().screen(&vynco::ScreeningRequest {
name: "Suspicious Corp".into(), uid: None, sources: None,
}).await?;
println!("Risk: {} ({} hits)", screening.data.risk_level, screening.data.hit_count);
let risk = client.ai().risk_score(&vynco::RiskScoreRequest {
uid: "CHE-105.805.080".into(),
}).await?;
println!("Risk score: {}/100 ({})", risk.data.overall_score, risk.data.risk_level);
let credits = client.credits().balance().await?;
println!("Credits remaining: {}", credits.data.balance);
Ok(())
}
Blocking Client
use vynco::blocking::Client;
fn main() -> Result<(), vynco::VyncoError> {
let client = Client::builder("vc_live_your_api_key")
.build()?;
let count = client.companies().count()?;
println!("Companies: {}", count.data.count);
Ok(())
}
API Coverage
18 resource modules covering 69 endpoints:
| Resource |
Methods |
health() |
check |
companies() |
list, get, count, events, statistics, compare, news, reports, relationships, hierarchy, fingerprint, nearby |
auditors() |
history, tenures |
dashboard() |
get |
screening() |
screen |
watchlists() |
list, create, delete, companies, add_companies, remove_company, events |
webhooks() |
list, create, update, delete, test, deliveries |
exports() |
create, get, download |
ai() |
dossier, search, risk_score |
api_keys() |
list, create, revoke |
credits() |
balance, usage, history |
billing() |
create_checkout, create_portal |
teams() |
me, create, members, invite_member, update_member_role, remove_member, billing_summary |
changes() |
list, by_company, statistics |
persons() |
board_members |
analytics() |
statistics, cantons, auditors, cluster, anomalies, rfm_segments, cohorts, candidates |
dossiers() |
create, list, get, delete |
graph() |
get, export, analyze |
Response Metadata
Every response includes header metadata for credit tracking and rate limiting:
let resp = client.companies().get("CHE-105.805.080").await?;
println!("Request ID: {:?}", resp.meta.request_id); println!("Credits used: {:?}", resp.meta.credits_used); println!("Credits remaining: {:?}", resp.meta.credits_remaining); println!("Rate limit: {:?}", resp.meta.rate_limit_limit); println!("Rate limit remaining: {:?}", resp.meta.rate_limit_remaining); println!("Rate limit reset: {:?}", resp.meta.rate_limit_reset); println!("Data source: {:?}", resp.meta.data_source);
Example CLI
A full CLI example is included to demonstrate real-world SDK usage:
export VYNCO_API_KEY="vc_live_your_api_key"
cargo run --example vynco_cli -- health cargo run --example vynco_cli -- companies --canton ZH --search "Novartis" cargo run --example vynco_cli -- company CHE-105.805.649 cargo run --example vynco_cli -- count cargo run --example vynco_cli -- events CHE-105.805.649 --limit 10 cargo run --example vynco_cli -- screen "Test Corp" cargo run --example vynco_cli -- dashboard cargo run --example vynco_cli -- auditors --min-years 10 --canton ZH cargo run --example vynco_cli -- risk CHE-105.805.649 cargo run --example vynco_cli -- fingerprint CHE-105.805.649 cargo run --example vynco_cli -- graph CHE-105.805.649 cargo run --example vynco_cli -- dossier CHE-105.805.649 cargo run --example vynco_cli -- compare CHE-105.805.649 CHE-109.340.740 cargo run --example vynco_cli -- credits cargo run --example vynco_cli -- team cargo run --example vynco_cli -- changes --page 1 --page-size 10 cargo run --example vynco_cli -- board-members CHE-105.805.649
See examples/vynco_cli.rs for the full source.
Configuration
use std::time::Duration;
let client = Client::builder("vc_live_your_api_key")
.base_url("https://api.vynco.ch") .timeout(Duration::from_secs(60)) .max_retries(3) .build()?;
The client automatically retries on HTTP 429 (rate limited) and 5xx (server error) with
exponential backoff (500ms x 2^attempt). It respects the Retry-After header when present.
Error Handling
All API errors are mapped to typed variants:
use vynco::VyncoError;
match client.companies().get("CHE-000.000.000").await {
Ok(resp) => println!("{}", resp.data.name),
Err(VyncoError::Authentication(_)) => println!("Invalid API key"),
Err(VyncoError::InsufficientCredits(_)) => println!("Top up credits"),
Err(VyncoError::Forbidden(_)) => println!("Insufficient permissions"),
Err(VyncoError::NotFound(body)) => println!("Not found: {:?}", body.detail),
Err(VyncoError::Validation(body)) => println!("Bad request: {:?}", body.detail),
Err(VyncoError::Conflict(_)) => println!("Resource conflict"),
Err(VyncoError::RateLimit(_)) => println!("Rate limited, retry later"),
Err(VyncoError::Server(_)) => println!("Server error"),
Err(e) => eprintln!("Error: {e}"),
}
Error bodies follow RFC 7807 Problem Details with
error_type, title, status, detail, and instance fields.
Feature Flags
| Feature |
Default |
Description |
rustls-tls |
Yes |
Use rustls for TLS (no OpenSSL dependency) |
native-tls |
No |
Use the platform's native TLS stack |
blocking |
No |
Enable the synchronous blocking client |
Minimum Supported Rust Version
Rust 1.83 or later.
License
Apache-2.0