The URL Pattern
Every filing document in EDGAR is served from this template:
https://www.sec.gov/Archives/edgar/data/{CIK}/{ACCESSION_NUMBER_NO_DASHES}/{PRIMARY_DOCUMENT}
Three pieces, three rules:
- {CIK}: the company's Central Index Key without leading zeros. Apple's CIK is
0000320193, but in the Archives path it becomes320193. (EDGAR also tolerates the zero-padded form, but the canonical path strips zeros.) - {ACCESSION_NUMBER_NO_DASHES}: the filing's accession number with all dashes removed.
0000320193-25-000079becomes000032019325000079. This 18-digit string is the folder name. - {PRIMARY_DOCUMENT}: the exact filename from the
primaryDocumentfield of the submissions API, e.g.aapl-20250927.htm. Keep it verbatim, including any subdirectory prefix such asxslF345X06/form4.xmlthat appears on Form 4 filings.
Where the Pieces Come From
The company's filing history lives at https://data.sec.gov/submissions/CIK##########.json, where the CIK is zero-padded to 10 digits (the opposite of the Archives rule). Inside filings.recent you get parallel arrays; index i across accessionNumber, form, filingDate, and primaryDocument describes one filing:
{
"cik": "0000320193",
"name": "Apple Inc.",
"filings": {
"recent": {
"accessionNumber": ["0000320193-25-000079", ...],
"form": ["10-K", ...],
"filingDate": ["2025-10-31", ...],
"primaryDocument": ["aapl-20250927.htm", ...]
}
}
}
See the full field-by-field breakdown in our data.sec.gov/submissions JSON structure guide.
Worked Example: Apple's FY2025 10-K
From the submissions JSON above:
- CIK
0000320193→ strip leading zeros →320193 - Accession number
0000320193-25-000079→ strip dashes →000032019325000079 - primaryDocument →
aapl-20250927.htm
Assemble:
https://www.sec.gov/Archives/edgar/data/320193/000032019325000079/aapl-20250927.htm
That URL returns the full 10-K HTML document (HTTP 200, verified). The same folder also serves supporting files: exhibits, XBRL instance documents, and images referenced by the primary document.
Listing a Filing's Files: index.json
To enumerate everything inside a filing folder, request index.json:
https://www.sec.gov/Archives/edgar/data/320193/000032019325000079/index.json
The response is a directory object whose item array lists each file:
{
"directory": {
"item": [
{"last-modified": "2025-10-31 06:01:26", "name": "0000320193-25-000079-index.html", "type": "text.gif", "size": ""},
{"last-modified": "2025-10-31 06:01:26", "name": "0000320193-25-000079.txt", "type": "text.gif", "size": ""},
{"last-modified": "2025-10-31 06:01:26", "name": "a10-kexhibit21109272025.htm", "type": "text.gif", "size": "11807"},
...
]
}
}
Useful entries in every folder:
{accession-with-dashes}-index.html: the human-readable filing index page (dashes are kept in this filename, unlike the folder name).{accession-with-dashes}.txt: the complete submission text file containing every document concatenated.{accession-with-dashes}-xbrl.zip: zipped XBRL data, when the filing has XBRL.
curl and Python Examples
curl
# SEC requires a declared User-Agent with contact info on every request
curl -A "YourName [email protected]" \
"https://data.sec.gov/submissions/CIK0000320193.json" -o aapl.json
curl -A "YourName [email protected]" \
"https://www.sec.gov/Archives/edgar/data/320193/000032019325000079/aapl-20250927.htm" \
-o aapl-10k.htm
Python: build the URL for the latest 10-K
import requests
HEADERS = {'User-Agent': 'YourName [email protected]'}
def latest_filing_url(cik, form_type='10-K'):
padded = str(int(cik)).zfill(10) # 10 digits for data.sec.gov
subs = requests.get(
f'https://data.sec.gov/submissions/CIK{padded}.json',
headers=HEADERS
).json()
recent = subs['filings']['recent']
for i, form in enumerate(recent['form']):
if form == form_type:
accession = recent['accessionNumber'][i].replace('-', '')
doc = recent['primaryDocument'][i]
cik_short = str(int(cik)) # no leading zeros for Archives
return (f'https://www.sec.gov/Archives/edgar/data/'
f'{cik_short}/{accession}/{doc}')
return None
print(latest_filing_url('0000320193'))
# https://www.sec.gov/Archives/edgar/data/320193/000032019325000079/aapl-20250927.htm
Common Gotchas
- Leading zeros flip between APIs.
data.sec.gov/submissions/CIK0000320193.jsonneeds the CIK padded to exactly 10 digits;sec.gov/Archives/edgar/data/320193/...strips them. Mixing these up is the number one cause of 404s. - Dashes are stripped only in the folder name. The folder is
000032019325000079, but filenames inside it (like0000320193-25-000079-index.html) keep the dashes. - The
-index.htmlsuffix. Appending{accession-with-dashes}-index.html(or.htm) to the folder URL gives the filing landing page, handy for linking humans rather than parsers. - primaryDocument can contain a slash. Ownership forms (3/4/5) often have values like
xslF345X06/form4.xml. Use the value as-is; do not URL-encode the slash. - User-Agent is mandatory. Requests without a User-Agent identifying you (name/company plus an email) are rejected with 403. Stay under about 10 requests per second or the SEC temporarily blocks your IP.
FAQ
How do I build a sec.gov/Archives/edgar/data URL?
Use https://www.sec.gov/Archives/edgar/data/{CIK}/{ACCESSION_NO_DASHES}/{PRIMARY_DOCUMENT}. The CIK has no leading zeros, the accession number has its dashes removed, and the primaryDocument filename comes from the submissions API.
Do I keep the leading zeros in the CIK for Archives URLs?
No. Archives paths use the CIK without leading zeros (320193 for Apple). Only data.sec.gov API filenames require the 10-digit zero-padded form.
How do I list all files inside a filing folder?
Append index.json to the filing folder URL. The response contains a directory.item array with every filename, last-modified timestamp, and size.
What User-Agent does the SEC require?
A User-Agent header identifying you with contact info, e.g. "CompanyName [email protected]". Requests without one return 403. Keep traffic under roughly 10 requests per second.
Related Guides
- data.sec.gov/submissions API: JSON Structure & recent Filings Arrays, where accessionNumber and primaryDocument come from
- SEC EDGAR Full-Text Search API (efts.sec.gov), search filing text by keyword
- data.sec.gov XBRL CompanyFacts API Documentation, structured financial data
- SEC CIK Number Lookup Guide, find any company's CIK
- SEC EDGAR API Rate Limits & Best Practices, avoid getting blocked