Recipe: OpenSanctions via self-hosted yente (no key)
- 1. Run yente
- 2. Point the adapter at it (no API key)
- 3. Or via framework config
- Hosted vs self-hosted
yente is the free, open-source API server behind
OpenSanctions. Running it yourself avoids the commercial-licence requirement of the hosted
API and keeps screening in your own infrastructure.
1. Run yente
# Minimal docker-compose (yente + its index); see the yente repo for the full file.
docker run -p 8000:8000 ghcr.io/opensanctions/yente:latest
# yente exposes the same /match API as the hosted service at http://localhost:8000
2. Point the adapter at it (no API key)
use Gawrys\Counterparty\Adapter\Sanctions\OpenSanctionsProvider;
use Gawrys\Counterparty\Check\SanctionsScreeningCheck;
$provider = new OpenSanctionsProvider($http, baseUri: 'http://localhost:8000'); // apiKey: null
$check = new SanctionsScreeningCheck($provider, $clock);
3. Or via framework config
Laravel - config/counterparty.php:
'sanctions' => [
'provider' => 'opensanctions',
'opensanctions' => ['base_uri' => env('OPENSANCTIONS_BASE_URI', 'http://localhost:8000')],
],
Symfony - config/packages/counterparty.yaml:
counterparty:
sanctions:
provider: opensanctions
opensanctions:
base_uri: '%env(OPENSANCTIONS_BASE_URI)%'
Hosted vs self-hosted
| sanctions.network | yente (self-hosted) | OpenSanctions hosted | |
|---|---|---|---|
| Cost | free | free (you run it) | paid licence |
| Key | none | none | required |
| Data freshness | provider-managed | you update the index | provider-managed |
| Default in toolkit | yes | - | - |
For most users the default sanctions.network is the simplest start; move to yente when you
need control over the dataset or to keep queries in-house.