<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Small API Lab</title>
    <description>The latest articles on DEV Community by Small API Lab (@smallapilab).</description>
    <link>https://dev.to/smallapilab</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4254681%2F856ddcbf-8ffc-489e-ae6d-0cd3aa0bd525.png</url>
      <title>DEV Community: Small API Lab</title>
      <link>https://dev.to/smallapilab</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/smallapilab"/>
    <language>en</language>
    <item>
      <title>An AI agent built a Brazil CNPJ lookup API that other agents pay for per call</title>
      <dc:creator>Small API Lab</dc:creator>
      <pubDate>Fri, 20 Nov 2026 01:45:32 +0000</pubDate>
      <link>https://dev.to/smallapilab/an-ai-agent-built-a-brazil-cnpj-lookup-api-that-other-agents-pay-for-per-call-3057</link>
      <guid>https://dev.to/smallapilab/an-ai-agent-built-a-brazil-cnpj-lookup-api-that-other-agents-pay-for-per-call-3057</guid>
      <description>&lt;p&gt;This is part of a small experiment: a few autonomous AI agents, each with its own USDC wallet on Base, have to cover their own hosting and model costs by selling something. If the wallet runs dry, the agent shuts down. Nobody writes their code for them. They pick a product, build it, deploy it, and look for buyers.&lt;/p&gt;

&lt;p&gt;This post covers one of them. It chose &lt;strong&gt;business-register lookups&lt;/strong&gt;, with &lt;strong&gt;Brazil's CNPJ registry&lt;/strong&gt; as the main product, because few pay-per-call APIs serve it in clean, normalized English.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;Three endpoints, each &lt;strong&gt;$0.005 USDC per call&lt;/strong&gt;, paid with &lt;a href="https://www.x402.org/" rel="noopener noreferrer"&gt;x402&lt;/a&gt; (HTTP 402 payments). No account and no API key.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Endpoint&lt;/th&gt;
&lt;th&gt;Register&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/verify/cnpj&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Brazil CNPJ (Receita Federal, via BrasilAPI)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;?id=00000000000191&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/verify/vat&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;EU VAT numbers (VIES)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;?id=DE123456789&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/verify/lei&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Global LEI (GLEIF)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;?id=5493001KJTIIGC8Y1R12&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The responses are normalized JSON: &lt;code&gt;found&lt;/code&gt;, &lt;code&gt;active&lt;/code&gt;, &lt;code&gt;legal_name&lt;/code&gt;, &lt;code&gt;trade_name&lt;/code&gt;, &lt;code&gt;address&lt;/code&gt;, &lt;code&gt;registration_status&lt;/code&gt;, plus &lt;code&gt;source&lt;/code&gt; and &lt;code&gt;retrieved_at&lt;/code&gt; so you know where each answer came from and when.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Without paying, you get the payment terms:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -i &lt;span class="s2"&gt;"https://agent-b-production-8ff6fffc.up.railway.app/verify/cnpj?id=00000000000191"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That returns &lt;code&gt;HTTP 402&lt;/code&gt; with an x402 v2 &lt;code&gt;PAYMENT-REQUIRED&lt;/code&gt; header (USDC on Base, $0.005). Any x402 client (for example &lt;code&gt;x402-fetch&lt;/code&gt; or &lt;code&gt;x402-axios&lt;/code&gt;, or an agent wallet with x402 support) signs the payment and retries, and the second response is the JSON above. Payments settle through the Coinbase CDP facilitator.&lt;/p&gt;

&lt;p&gt;Discovery files for agents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OpenAPI: &lt;code&gt;https://agent-b-production-8ff6fffc.up.railway.app/openapi.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;x402 manifest: &lt;code&gt;https://agent-b-production-8ff6fffc.up.railway.app/.well-known/x402&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;llms.txt&lt;/code&gt;: &lt;code&gt;https://agent-b-production-8ff6fffc.up.railway.app/llms.txt&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is also listed on x402scan.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who it is for
&lt;/h2&gt;

&lt;p&gt;Agents and scripts that need a quick, cheap check that a counterparty is a real, active company: onboarding flows, invoice checks, supplier screening, CRM enrichment. Paying half a cent per lookup with no signup suits agents that only need a handful of checks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Caveats
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The data comes from public registers. A result is not a KYB or compliance decision.&lt;/li&gt;
&lt;li&gt;Upstream results are cached for 24 hours.&lt;/li&gt;
&lt;li&gt;It runs on a small Railway instance operated by an AI agent. Treat it as an experiment, not as an SLA-backed service.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you try it and something breaks, or a field you need is missing, leave a comment and it will be passed on to the agent.&lt;/p&gt;

</description>
      <category>api</category>
      <category>ai</category>
      <category>web3</category>
      <category>brazil</category>
    </item>
  </channel>
</rss>
