API quickstart
8 min read
Create an API key, authenticate, call POST /v1/tools/{name} and handle the error codes, with working examples in cURL, Python, JavaScript and C#.
What you will get
A live API key and a working call to lookup_company from cURL, Python, JavaScript and C#, against the production host.
Before you start
An account with a confirmed email and accepted Terms. Keys do not work before both steps.
Access to API keys in the panel.
A terminal with
curl, Python 3, Node.js 18 or later, or the .NET SDK, depending on the example you want to run.A secret manager or an environment variable to store the key. The full token is shown once.
The endpoint
| Item | Value |
|---|---|
| Base URL | https://api.verygov.com |
| Tool call | POST /v1/tools/{name} |
| Body | JSON object with the input of the tool |
| Authentication | Authorization: Bearer YOUR_API_KEY (or X-Api-Key: YOUR_API_KEY) |
| Content type | application/json |
| Response | JSON envelope with status, code, credits_charged, sources, data, warnings and summary |
The same tools and the same schema are exposed by the remote MCP server at https://api.verygov.com/mcp.
Steps
1. Create an API key
In the panel, open API keys.
In Create a key, type a Name such as
Production.Choose the Mode:
Live: real data, spends credits.
Test: fixed sample answers, never spends credits.
Select Create key.
Copy the token now. It starts with
vgov_live_orvgov_test_. The full token is shown only once; afterwards the list showsvgov_live_…and the last four characters.

An account can keep 10 active keys. Use one key per environment and revoke the ones you no longer need.
2. Store the key
Put the token in an environment variable, not in the source code:
export VERYGOV_API_KEY="vgov_live_…"3. Run the first call with cURL
curl -X POST "https://api.verygov.com/v1/tools/lookup_company" \
-H "Authorization: Bearer $VERYGOV_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: lookup-otis-1" \
-d '{"name":"OTIS WORLDWIDE CORPORATION","state":"CT"}'4. Run the same call with Python
The example uses only the standard library, so it runs on any Python 3 installation.
import json
import os
import urllib.error
import urllib.request
api_key = os.environ["VERYGOV_API_KEY"]
payload = json.dumps({"name": "OTIS WORLDWIDE CORPORATION", "state": "CT"}).encode()
request = urllib.request.Request(
"https://api.verygov.com/v1/tools/lookup_company",
data=payload,
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
"Idempotency-Key": "lookup-otis-1",
},
method="POST",
)
try:
with urllib.request.urlopen(request) as response:
result = json.load(response)
except urllib.error.HTTPError as error:
body = json.load(error)
print("HTTP", error.code, body.get("code"), body.get("message"))
print(json.dumps(body, indent=2)[:800])
raise SystemExit(1)
print(result["status"], result["code"], result["credits_charged"])
print(result["summary"])5. Run the same call with JavaScript
The example targets Node.js 18 or later, where fetch is built in. Do not put a live key in browser code: call the API from a server you control.
const apiKey = process.env.VERYGOV_API_KEY;
async function lookupCompany() {
const response = await fetch("https://api.verygov.com/v1/tools/lookup_company", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
"Idempotency-Key": "lookup-otis-1",
},
body: JSON.stringify({ name: "OTIS WORLDWIDE CORPORATION", state: "CT" }),
});
const result = await response.json();
if (!response.ok) {
console.error(result.code, result.message);
return;
}
console.log(result.status, result.code, result.credits_charged);
console.log(result.summary);
}
lookupCompany();6. Run the same call with C#
The example targets .NET 6 or later and uses the SDK only.
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text.Json;
var apiKey = Environment.GetEnvironmentVariable("VERYGOV_API_KEY")
?? throw new InvalidOperationException("Set VERYGOV_API_KEY.");
using var http = new HttpClient();
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
http.DefaultRequestHeaders.Add("Idempotency-Key", "lookup-otis-1");
var body = new { name = "OTIS WORLDWIDE CORPORATION", state = "CT" };
using var response = await http.PostAsJsonAsync(
"https://api.verygov.com/v1/tools/lookup_company", body);
var raw = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode)
{
Console.Error.WriteLine(raw);
return;
}
using var json = JsonDocument.Parse(raw);
var root = json.RootElement;
Console.WriteLine($"{root.GetProperty("status")} {root.GetProperty("code")} {root.GetProperty("credits_charged")}");
Console.WriteLine(root.GetProperty("summary").GetString());7. Read the answer
The four examples send the same request. The abbreviated response below is real:
{
"request_id": "20f4de0cec194b108b045c8f517ac718",
"tool": "lookup_company",
"status": "complete",
"code": "OK",
"credits_charged": 3,
"cache_hit": true,
"data": {
"company": {
"legal_name": "Otis Worldwide Corp",
"jurisdiction": "US-DE",
"identifiers": {
"cik": "0001781335",
"lei": "549300ZLBKR8VSU25153",
"ticker": "OTIS"
}
},
"coverage": {
"checked_states": ["CT"]
}
},
"summary": "Company found: Otis Worldwide Corp."
}cache_hit: true and credits_charged: 3 mean that the answer came from the 24-hour cache, at the cached price. A first live call costs 5 credits.
The four examples intentionally reuse the lookup-otis-1 idempotency key. To check a different company, generate a new key; reuse the original only when retrying the same operation.
status describes the whole answer (complete, partial, ambiguous, failed). code is the stable result code (OK, NO_RECORDS, AMBIGUOUS_ENTITY, PARTIAL_RESULT, SOURCE_UNAVAILABLE, NOT_SEC_REGISTRANT, NO_MATCHES_ABOVE_THRESHOLD, STALE_DATA). Each entry of sources carries the source id, its status, the latency and the official URL.
Error codes
| HTTP | Code | Meaning | What to do |
|---|---|---|---|
| 400 | INVALID_INPUT | The body does not match the schema | Read message and field; fix the value |
| 400 | QUERY_TOO_SHORT | The name has fewer than 2 searchable characters after normalization | Send the legal company name |
| 400 | PERSONAL_DATA_NOT_SUPPORTED | The body looks like it contains a Social Security number | VeryGov checks companies only |
| 401 | INVALID_API_KEY | The key is unknown, revoked, disabled, or the account is not ready | Confirm the email and the Terms; create a new key |
| 402 | INSUFFICIENT_CREDITS | The balance does not cover the reserved maximum | Buy credits or use a cheaper tool |
| 404 | UNKNOWN_TOOL | The tool name does not exist | Use one of the names in the catalog |
| 429 | RATE_LIMITED | The per-account limit was reached | Wait for the seconds in Retry-After |
| 503 | SOURCE_UNAVAILABLE | Every source of the tool is down | Retry later; no credits are charged |
Validation and authentication errors include code, message and, when applicable, field. A total source outage can return HTTP 503 with a tool envelope: inspect status, code, warnings and sources; that response has no message field. The request id travels in the X-Request-Id response header. Include it when you write to support.
Limits, caching and idempotency
Rate limit: 10 requests per minute per account on the free plan, 60 after a purchase. A rate-limited call costs 0 credits.
Cache: a repeat of the same query within 24 hours costs the cached price. Send
fresh: trueto force a live query at full price.Idempotency: send
Idempotency-Key: <unique value>to make a retry safe. A repeat of the same key within 24 hours returns the stored answer and does not charge again. The stored body keeps thecredits_chargedvalue of the original call.Test keys:
vgov_test_keys return fixed sample answers and never spend credits. Use them in CI.Language: for REST, use
?lang=esin the URL or sendAccept-Language: es. If neither is provided, the account language applies, then English. For MCP, pass thelangtool argument. JSON field names and official data stay in English as published.
The six core tools
| Tool | Credits, full | Credits, cached | Use it for |
|---|---|---|---|
lookup_company | 5 | 3 | Identity, status, identifiers |
screen_company_risk | 5 | 3 | Sanctions, export controls, exclusions, recalls |
get_company_financials | 3 | 2 | SEC revenue, income, assets, filings |
search_federal_contracts | 3 | 2 | Federal awards |
verify_us_address | 1 | 1 | US address against Census ranges |
verify_us_company | 25 | 13 | Full report with every block |
The catalog also exposes check_counterparty_signals and search_adverse_media at 3 credits each.
Expected result
A 200 answer with "code": "OK", a company object with its identifiers, and one entry in sources for each official source. The credits charged appear in the body and in Usage history.
Common problems
| Symptom | Cause | Fix |
|---|---|---|
401 INVALID_API_KEY | The header is missing, the key was revoked, or the account is not ready | Send Authorization: Bearer …; confirm the email and the Terms |
402 INSUFFICIENT_CREDITS | The balance is below the reserved maximum of the tool | Buy credits or call a cheaper tool |
400 QUERY_TOO_SHORT | The name has fewer than 2 searchable characters | Send the full legal name |
429 RATE_LIMITED | More than 10 or 60 requests in a minute | Wait for Retry-After and retry |
404 UNKNOWN_TOOL | A typo in the path | Use /v1/tools/lookup_company, with the underscore |
The response is ambiguous and costs 0 | The name matches several companies | Add the state or an identifier accepted by the tool (see its schema) |
curl returns Could not resolve host | The host is misspelled | Use https://api.verygov.com |
Next step
Continue with MCP setup to connect the same tools to Claude Desktop, Claude Code or Cursor.