Step 1: collect the distinct CUSIPs

Berkshire Hathaway filed its 13F for the quarter ending 30 September 2026 on 16 November 2026. The information table has 89 rows but only 30 distinct CUSIPs, because Berkshire reports one stock on several rows, one per manager line. Map the 30 and join the result back to all 89 rows.

The table is XML on EDGAR. Like every SEC file, it needs a User-Agent header with your name and email.

Step 2: send the CUSIPs to OpenFIGI

A single lookup looks like this:

curl -s https://api.openfigi.com/v3/mapping \
  -H 'Content-Type: application/json' \
  -d '[{"idType":"ID_CUSIP","idValue":"037833100","exchCode":"US"}]'

OpenFIGI answers with one row for Apple: ticker AAPL, exchange code US, security type Common Stock. When we left out "exchCode":"US", the same CUSIP returned 303 rows, one per trading venue. Keep the filter, or pick the US row yourself.

OpenFIGI's documentation sets these limits for /v3/mapping, and the response headers we saw carried ratelimit-policy: 25;w=60:

LimitNo API keyFree API key
Requests per minute25250
CUSIPs per request10100
Over the CUSIP limitHTTP 413HTTP 413
Over the request limitHTTP 429HTTP 429

We sent 11 CUSIPs in one request without a key and got HTTP 413. Without a key you can map up to 250 CUSIPs a minute, so a 13F with a few thousand rows takes several minutes.

Step 3: handle the three traps

A first script that sent every CUSIP as ID_CUSIP with the US filter missed three cases.

CaseCUSIPPlain lookupFixTicker
Non-US issuerH1467J104 (Chubb)"No identifier found."idType: ID_CINSCB
Non-US issuerT19377109 (Bending Spoons)"No identifier found."idType: ID_CINSBSP
Delisted stock812350106 (Sears Holdings)"No identifier found."includeUnlistedEquities: trueSHLDQ

A code that starts with a letter is a CINS, the CUSIP International Numbering System code for an issuer outside the US. OpenFIGI wants these sent as ID_CINS. Sears is not in the Berkshire filing; we added it to test what happens to a delisted stock. OpenFIGI's documentation says the API leaves out equities that are not listed on an exchange unless you set includeUnlistedEquities to true.

Share classes bring a third format problem. OpenFIGI returns Lennar's class B shares as LEN/B, while the SEC's company tickers file lists them as LEN-B. Pick one form and convert the other, or the join to SEC data drops the row.

Step 4: run the whole table

This script reads the 13F, sends the CUSIPs in batches of 10 and prints each ticker next to both names. It uses only the Python standard library.

import json
import time
import urllib.request
import xml.etree.ElementTree as ET

SEC_URL = "https://www.sec.gov/Archives/edgar/data/1067983/000119312526463399/60471.xml"
SEC_HEADERS = {"User-Agent": "Your Name your.email@example.com"}
FIGI_URL = "https://api.openfigi.com/v3/mapping"
NS = {"t": "http://www.sec.gov/edgar/document/thirteenf/informationtable"}

def get(url, headers):
    req = urllib.request.Request(url, headers=headers)
    with urllib.request.urlopen(req) as resp:
        return resp.read()

def figi(jobs):
    req = urllib.request.Request(
        FIGI_URL,
        data=json.dumps(jobs).encode(),
        headers={"Content-Type": "application/json"},
    )
    with urllib.request.urlopen(req) as resp:
        return json.load(resp)

def job(cusip):
    # A CUSIP that starts with a letter is a CINS code for a non-US issuer.
    id_type = "ID_CINS" if cusip[0].isalpha() else "ID_CUSIP"
    return {"idType": id_type, "idValue": cusip, "exchCode": "US",
            "includeUnlistedEquities": True}

root = ET.fromstring(get(SEC_URL, SEC_HEADERS))
names = {}
for row in root.findall("t:infoTable", NS):
    names[row.findtext("t:cusip", namespaces=NS)] = row.findtext("t:nameOfIssuer", namespaces=NS)
cusips = sorted(names)
print(len(root.findall("t:infoTable", NS)), "rows,", len(cusips), "distinct CUSIPs")

for i in range(0, len(cusips), 10):          # 10 jobs per request without a key
    batch = cusips[i:i + 10]
    for cusip, result in zip(batch, figi([job(c) for c in batch])):
        hit = result.get("data", [{}])[0]
        print(cusip, hit.get("ticker", "NOT FOUND"), "|", names[cusip], "|", hit.get("name"))
    time.sleep(3)                             # stay under 25 requests a minute

When we ran it on 2 December 2026, it printed "89 rows, 30 distinct CUSIPs" and a ticker for every CUSIP.

Step 5: check the names, join on the code

Compare the mapped name with the 13F issuer name as a sanity check. Expect them to differ in spelling. The 13F says "NEW YORK TIMES CO MTN BE" and "SIRIUSXM HOLDINGS INC"; OpenFIGI says "NEW YORK TIMES CO-A" and "SIRIUS XM HOLDINGS INC". Match on CUSIP and use names only to catch a wrong hit.

The result for Berkshire's Q3 2026 13F

All 30 CUSIPs mapped to one US ticker each: ALLY, GOOG, GOOGL, AXP, AAPL, BAC, COF, CVX, KO, DHI, DVA, DAL, JEF, KHC, KR, LEN, LEN/B, LLYVA, LLYVK, LPX, M, MCO, NVR, NYT, NUE, OXY, SIRI, VRSN, CB and BSP. Alphabet, Lennar and Liberty Live each appear with two share classes, and each class has its own CUSIP and its own ticker.

OpenFIGI has its own terms of service. Read them before you build the mapping into a product or store the results for other people.

Younesa is building US company data from SEC filings.