Openmercantil SDK

Openmercantil SDK

OpenMercantil API client, generated from the OpenAPI spec.

Versioned public-read, browser-account, billing, support and provider-callback contracts.

Learn more about OpenMercantil API at openmercantil.es/api/documentacion.

This is an unofficial SDK for the OpenMercantil public API, generated by Voxgig with @voxgig/sdkgen. It is not affiliated with, endorsed by, or sponsored by the upstream API provider.

Learn more about Voxgig SDKs at voxgig.com/sdk.

Metadata kindly supplied by www.freepublicapis.com.

TypeScript, Python, PHP, Golang, Ruby, Lua SDKs, a CLI, an interactive REPL, and an MCP server for AI agents — all generated from one OpenAPI spec by @voxgig/sdkgen.

Entities, not endpoints

This SDK exposes the API as 113 semantic entities that you call directly, instead of assembling URL paths and query strings. See the Entities table below for the full list. Entities are Capitalised to mark them as the primary surface, each with the operations they support (list, load, create, update, remove):

const client = new OpenmercantilSDK()
const apicredential = await client.ApiCredential().create({
  scope: [],
})

Thinking in entities keeps the mental model small — for people and AI agents alike — rather than reasoning about raw HTTP routes and query parameters.

Offline unit testing

Every SDK ships a built-in test mode that swaps the HTTP transport for an in-memory mock, so your unit tests run fully offline — no server, no network, and no credentials:

TypeScript

const client = OpenmercantilSDK.test()
const billing = await client.Billing().load({ id: 'test01' })
// billing is a bare Billing populated with mock data
console.log(billing)

Python

client = OpenmercantilSDK.test()
billing = client.Billing().load({"id": "test01"})
print(billing)

PHP

// Seed fixture data so offline calls resolve without a live server.
$client = OpenmercantilSDK::test([
    "entity" => ["billing" => ["test01" => ["id" => "test01"]]],
]);
$billing = $client->Billing()->load(["id" => "test01"]);

Golang

client := sdk.Test()
result, err := client.Billing(nil).Load(
    map[string]any{"id": "test01"}, nil,
)

Ruby

# Seed fixture data so offline calls resolve without a live server.
client = OpenmercantilSDK.test({
  "entity" => { "billing" => { "test01" => { "id" => "test01" } } },
})
billing = client.Billing.load({ "id" => "test01" })

Lua

local client = sdk.test()
local result, err = client:Billing():load({ id = "test01" })

Packages

LanguagePackageInstall
TypeScript@voxgig-sdk/openmercantilpublish pending — install from git tag
Pythonvoxgig-sdk-openmercantilpublish pending — install from git tag
PHPvoxgig-sdk/openmercantilpublish pending — install from git tag
Golanggithub.com/voxgig-sdk/openmercantil-sdk/gogo get github.com/voxgig-sdk/openmercantil-sdk/go@latest
Rubyvoxgig-sdk-openmercantilpublish pending — install from git tag
Luavoxgig-sdk-openmercantilpublish pending — install from git tag
Go CLIgithub.com/voxgig-sdk/openmercantil-sdk/go-cligo install github.com/voxgig-sdk/openmercantil-sdk/go-cli/cmd/openmercantil@latest
Go MCP servergithub.com/voxgig-sdk/openmercantil-sdk/go-mcpgo get github.com/voxgig-sdk/openmercantil-sdk/go-mcp@latest

Quickstart

TypeScript

import { OpenmercantilSDK } from '@voxgig-sdk/openmercantil'

const client = new OpenmercantilSDK({
  apikey: process.env.OPENMERCANTIL_APIKEY,
})


// Load a specific companyactivityscore (returns a CompanyActivityScore)
const companyactivityscore = await client.CompanyActivityScore().load({
  slug: 'example_slug',
})
console.log(companyactivityscore)

See the TypeScript README for the full guide.

Surfaces

SurfacePath
SDK (TypeScript, Python, PHP, Golang, Ruby, Lua)ts/ py/ php/ go/ rb/ lua/
CLIgo-cli/
MCP servergo-mcp/

Use it from an AI agent (MCP)

The generated MCP server exposes every operation in this SDK as an MCP tool that Claude, Cursor or Cline can call directly. Build and register it:

cd go-mcp && go build -o openmercantil-mcp .

Then add it to your agent’s MCP config (Claude Desktop, Cursor, etc.):

{
  "mcpServers": {
    "openmercantil": {
      "command": "/abs/path/to/openmercantil-mcp"
    }
  }
}

Entities

The API exposes 113 entities:

EntityDescriptionAPI path
ApiCredentialThe ApiCredential entity (create)./api/v1/user/api-credentials
ApiCredentialOneTimeThe ApiCredentialOneTime entity (create)./api/v1/user/api-credentials/{id}/rotate
BillingThe Billing entity (create, load)./api/v1/stripe-webhook
BillingInvoiceThe BillingInvoice entity (list)./api/v1/billing/invoices
CcaaStatThe CcaaStat entity (list)./api/v1/ccaa/stats
CnaeThe Cnae entity (load)./api/v1/cnae/{code}
CnaeTreeThe CnaeTree entity (list)./api/v1/cnae/tree
CompanyThe Company entity (list, load)./api/v1/company/{slug}/risk-signals
CompanyAccountThe CompanyAccount entity (list)./api/v1/company/{slug}/accounts
CompanyActivityThe CompanyActivity entity (list)./api/v1/company/{slug}/activity
CompanyActivityScoreThe CompanyActivityScore entity (load)./api/v1/company/{slug}/score
CompanyAeatDebtorThe CompanyAeatDebtor entity (list)./api/v1/company/{slug}/aeat-moroso
CompanyBdeThe CompanyBde entity (list)./api/v1/company/{slug}/bde
CompanyCnmvThe CompanyCnmv entity (list)./api/v1/company/{slug}/cnmv
CompanyCompareThe CompanyCompare entity (list)./api/v1/companies/compare
CompanyEmbargoThe CompanyEmbargo entity (list)./api/v1/company/{slug}/embargoes
CompanyEnrichmentThe CompanyEnrichment entity (list)./api/v1/company/{slug}/enrichment
CompanyEventThe CompanyEvent entity (list)./api/v1/company/{slug}/events
CompanyFactThe CompanyFact entity (list)./api/v1/company/{slug}/facts
CompanyGrantThe CompanyGrant entity (list)./api/v1/company/{slug}/grants
CompanyGraphThe CompanyGraph entity (load)./api/v1/grafo/{slug}
CompanyLeiThe CompanyLei entity (list)./api/v1/company/{slug}/lei
CompanyProcurementThe CompanyProcurement entity (list)./api/v1/company/{slug}/contracts
CompanyRelationshipThe CompanyRelationship entity (list)./api/v1/company/{slug}/relationships
CompanyReportThe CompanyReport entity (list)./api/v1/company/{slug}/export
CompanySanctionThe CompanySanction entity (list)./api/v1/company/{slug}/sanctions
CompanySimilarThe CompanySimilar entity (list)./api/v1/company/{slug}/similar
CompanySourceThe CompanySource entity (list)./api/v1/company/{slug}/sources
CompanyTedThe CompanyTed entity (list)./api/v1/company/{slug}/ted
CompanyWikidataThe CompanyWikidata entity (list)./api/v1/company/{slug}/wikidata
CredentialRevokedThe CredentialRevoked entity (remove)./api/v1/user/api-credentials/{id}
DailyThe Daily entity (load)./api/v1/daily/{date}
DailySummaryThe DailySummary entity (load)./api/v1/summary/date/{date}
DatasetThe Dataset entity (load)./api/v1/export/companies
DeletedThe Deleted entity (remove)./api/v1/user/webhooks/{id}
EmailDispatchThe EmailDispatch entity (create)./api/v1/user/org/invites/{id}/resend
ExportUsageThe ExportUsage entity (load)./api/v1/user/exports/usage
HealthThe Health entity (load)./api/v1/health
IntegrationThe Integration entity (list, load)./api/v1/integrations
KycPersonLookupThe KycPersonLookup entity (create)./api/v1/persons/lookup
KycPersonLookupHistoryThe KycPersonLookupHistory entity (list)./api/v1/persons/lookup/history
KycPersonLookupUsageThe KycPersonLookupUsage entity (load)./api/v1/persons/lookup/usage
LegalActMapThe LegalActMap entity (list)./api/v1/legal/act-map
LegalActMapEntryThe LegalActMapEntry entity (load)./api/v1/legal/act-map/{acto}
LegalArticleThe LegalArticle entity (load)./api/v1/legal/article/{norm}/{n}
LegalNormThe LegalNorm entity (load)./api/v1/legal/norm/{slug}
LegalNormsIndexThe LegalNormsIndex entity (list)./api/v1/legal/norm
LegalReportThe LegalReport entity (create)./api/v1/empresa/{slug}/informe-legal
OfficerThe Officer entity (list)./api/v1/company/{slug}/officers
OknThe Okn entity (create)./api/v1/support/ticket/{id}/reply
Okn10The Okn10 entity (update)./api/v1/user/org
Okn11The Okn11 entity (remove)./api/v1/user/org/invites/{id}
Okn12The Okn12 entity (create)./api/v1/user/org/leave
Okn13The Okn13 entity (update)./api/v1/user/org/members/{id}
Okn14The Okn14 entity (remove)./api/v1/user/org/members/{id}
Okn15The Okn15 entity (update)./api/v1/user/segments/{id}
Okn16The Okn16 entity (update)./api/v1/user/segments/{id}
Okn17The Okn17 entity (remove)./api/v1/user/segments/{id}
Okn18The Okn18 entity (remove)./api/v1/user/tags/{id}
Okn19The Okn19 entity (create)./api/v1/user/tags/{id}/assign
Okn2The Okn2 entity (update)./api/v1/user/lists/{id}
Okn20The Okn20 entity (create)./api/v1/user/tags/{id}/unassign
Okn3The Okn3 entity (update)./api/v1/user/lists/{id}
Okn4The Okn4 entity (remove)./api/v1/user/lists/{id}
Okn5The Okn5 entity (create)./api/v1/user/lists/{id}/items
Okn6The Okn6 entity (remove)./api/v1/user/lists/{id}/items/{item_id}
Okn7The Okn7 entity (update)./api/v1/user/notes/{id}
Okn8The Okn8 entity (update)./api/v1/user/notes/{id}
Okn9The Okn9 entity (remove)./api/v1/user/notes/{id}
OrgThe Org entity (create)./api/v1/user/org
OrganizationInviteCreatedThe OrganizationInviteCreated entity (create)./api/v1/user/org/invites
OutboundWebhookOneTimeThe OutboundWebhookOneTime entity (create)./api/v1/user/webhooks/{id}/rotate
PersonThe Person entity (load)./api/v1/person/{slug}
PersonDocumentaryReportThe PersonDocumentaryReport entity (load)./api/v1/persona/{slug}
PersonGraphThe PersonGraph entity (load)./api/v1/grafo/persona/{slug}
PersonSearchThe PersonSearch entity (list)./api/v1/person/search
PublicThe Public entity (list)./api/v1/datasets/public
PublicProcurementThe PublicProcurement entity (load)./api/v1/tenders/{key}
PublicSourceStatusThe PublicSourceStatus entity (list)./api/v1/sources/status
SearchThe Search entity (list)./api/v1/search
SectorCompanyThe SectorCompany entity (list)./api/v1/sector/{cnae}/companies
SectorRatioThe SectorRatio entity (list)./api/v1/sector/{cnae}/ratios
SectorStatThe SectorStat entity (list)./api/v1/sectores/stats
SourceThe Source entity (list)./api/v1/sources/freshness
StripeSessionThe StripeSession entity (create)./api/v1/checkout
SupportTicketCreatedThe SupportTicketCreated entity (create)./api/v1/support/ticket
SystemThe System entity (load)./api/v1/stats
TenderThe Tender entity (list)./api/v1/tenders
TenderStatThe TenderStat entity (list)./api/v1/tenders/stats
TenderSupplierThe TenderSupplier entity (list)./api/v1/contracts/top-companies
UserThe User entity (list, load)./api/v1/user/api-credentials
UserAuditThe UserAudit entity (list)./api/v1/user/audit
UserExportListThe UserExportList entity (list)./api/v1/user/exports
UserListCreatedThe UserListCreated entity (create)./api/v1/user/lists
UserListDetailThe UserListDetail entity (load)./api/v1/user/lists/{id}
UserListListThe UserListList entity (list)./api/v1/user/lists
UserMeThe UserMe entity (load)./api/v1/user/me
UserNoteThe UserNote entity (load)./api/v1/user/notes/{id}
UserNoteCreatedThe UserNoteCreated entity (create)./api/v1/user/notes
UserNoteListThe UserNoteList entity (list)./api/v1/user/notes
UserNotesForTargetThe UserNotesForTarget entity (list)./api/v1/user/notes/for/{type}/{id}
UserOrganizationThe UserOrganization entity (list)./api/v1/user/org
UserPersonaThe UserPersona entity (list)./api/v1/user/persona
UserPersonaSelectedThe UserPersonaSelected entity (create)./api/v1/user/persona
UserSegmentThe UserSegment entity (load)./api/v1/user/segments/{id}
UserSegmentCreatedThe UserSegmentCreated entity (create)./api/v1/user/segments
UserSegmentListThe UserSegmentList entity (list)./api/v1/user/segments
UserSegmentPinThe UserSegmentPin entity (create)./api/v1/user/segments/{id}/pin
UserSegmentRunThe UserSegmentRun entity (create)./api/v1/user/segments/{id}/run
UserTagCreatedThe UserTagCreated entity (create)./api/v1/user/tags
UserTagListThe UserTagList entity (list)./api/v1/user/tags
VerificationDispatchThe VerificationDispatch entity (create)./api/v1/resend-verification
WebhookThe Webhook entity (update)./api/v1/user/webhooks/{id}

The operations available across these entities are load, list, create, update, remove — see each entity’s own list above for exactly which it supports.

Quickstart in other languages

Python

import os
from openmercantil_sdk import OpenmercantilSDK

client = OpenmercantilSDK({
    "apikey": os.environ.get("OPENMERCANTIL_APIKEY"),
})

PHP

<?php
require_once 'openmercantil_sdk.php';

$client = new OpenmercantilSDK([
    "apikey" => getenv("OPENMERCANTIL_APIKEY"),
]);

Golang

import sdk "github.com/voxgig-sdk/openmercantil-sdk/go"

client := sdk.NewOpenmercantilSDK(map[string]any{
    "apikey": os.Getenv("OPENMERCANTIL_APIKEY"),
})


// Load a specific companyactivityscore
companyActivityScore, err := client.CompanyActivityScore(nil).Load(
    map[string]any{"slug": "example_slug"}, nil,
)
if err != nil {
    panic(err)
}
fmt.Println(companyActivityScore)

Ruby

require_relative "Openmercantil_sdk"

client = OpenmercantilSDK.new({
  "apikey" => ENV["OPENMERCANTIL_APIKEY"],
})

Lua

local sdk = require("openmercantil_sdk")

local client = sdk.new({
  apikey = os.getenv("OPENMERCANTIL_APIKEY"),
})

Direct and prepare

For endpoints the entity model doesn’t cover, use the low-level methods:

  • direct(fetchargs) — build and send an HTTP request in one step.
  • prepare(fetchargs) — build the request without sending it.

Both accept a map with path, method, params, query, headers, and body. See the How-to guides below.

How-to guides

Make a direct API call

When the entity interface does not cover an endpoint, use direct:

TypeScript:

const result = await client.direct({
  path: '/api/resource/{id}',
  method: 'GET',
  params: { id: 'example' },
})
if (result instanceof Error) {
  throw result
}
console.log(result.data)

Python:

result = client.direct({
    "path": "/api/resource/{id}",
    "method": "GET",
    "params": {"id": "example"},
})

PHP:

$result = $client->direct([
    "path" => "/api/resource/{id}",
    "method" => "GET",
    "params" => ["id" => "example"],
]);

Go:

result, err := client.Direct(map[string]any{
    "path":   "/api/resource/{id}",
    "method": "GET",
    "params": map[string]any{"id": "example"},
})
if err != nil {
    panic(err)
}
fmt.Println(result)

Ruby:

result = client.direct({
  "path" => "/api/resource/{id}",
  "method" => "GET",
  "params" => { "id" => "example" },
})

Lua:

local result, err = client:direct({
  path = "/api/resource/{id}",
  method = "GET",
  params = { id = "example" },
})

Advanced

Everyday use only needs the sections above. This explains the internals behind every call — relevant when writing custom features.

Every SDK call runs the same five-stage pipeline:

  1. Point — resolve the API endpoint from the operation definition.
  2. Spec — build the HTTP specification (URL, method, headers, body).
  3. Request — send the HTTP request.
  4. Response — receive and parse the response.
  5. Result — extract the result data for the caller.

A feature hook fires at each stage (e.g. PrePoint, PreSpec, PreRequest), so features can inspect or modify the pipeline without forking the SDK.

Features

FeaturePurpose
TestFeatureIn-memory mock transport for testing without a live server

Pass custom features via the extend option at construction time.

Per-language documentation

Upstream API

This SDK is generated from the upstream OpenAPI specification. It is an unofficial client and is not affiliated with the API provider.

Security

Please report security issues to security@voxgig.com. See SECURITY.md. Do not open public issues for suspected vulnerabilities.


Generated from the OpenMercantil API OpenAPI spec by @voxgig/sdkgen.

Get the Voxgig dispatch

Short notes on building SDKs, CLIs, REPLs, and MCPs for API-first teams, plus the occasional Fireside episode pick.

By signing up you agree to our Terms and Conditions.