Filing Download & PDF Generator API

The Filing Download API supports downloading all 20 million SEC filings, and all 100 million exhibits, attachments, and other EDGAR files from any of the 800,000 filers between 1993/1994 to the present. All EDGAR form types are accessible and the API supports up to 60,000 downloads per API key within a five-minute window.

The Download API has a total throughput capacity of over 1 million requests per second, and provides access to more than 1,000 terabytes of SEC filings data, including original filing publications in HTML/TXT format, filing index pages, SGML headers, complete submission files, PDFs, images, XML and XBRL files, Excel files, and many more.

New EDGAR files (filings, exhibits, etc.) are accessible via the Download API in approximately 300 milliseconds after publication on EDGAR.

Mapping of EDGAR Filing URL to Download API and New Endpoint
┌──────────────────────────────────────────────────────────────────────────────┐ │ Original EDGAR File URL │ │ 10 requests / second │ └──────────────────────────────────────────────────────────────────────────────┘ https://www.sec.gov/Archives/edgar/data/815094/000156459021006205/abmd-8k_20210211.htm │ │ ▼ ┌──────────────────────────────────────────────────────────────────────────────┐ │ Download API URL │ │ 50 requests / second │ └──────────────────────────────────────────────────────────────────────────────┘ https://archive.sec-api.io/815094/000156459021006205/abmd-8k_20210211.htm │ │ ▼ ┌──────────────────────────────────────────────────────────────────────────────┐ │ New Download API URL (Beta) │ │ Capacity of 1+ million requests / second │ └──────────────────────────────────────────────────────────────────────────────┘ https://edgar-mirror.sec-api.io/815094/000156459021006205/abmd-8k_20210211.htm https://edgar-mirror.sec-api.io/0000815094/000156459021006205/abmd-8k_20210211.htm https://edgar-mirror.sec-api.io/000156459021006205/abmd-8k_20210211.htm https://edgar-mirror.sec-api.io/Archives/edgar/data/815094/000156459021006205/abmd-8k_20210211.htm

All 400+ EDGAR form types are accessible, including annual and quarterly reports (Forms 10-K, 10-Q, 20-F, 40-F), event-driven disclosures (Forms 8-K, 6-K), registration statements (S-1, S-3, S-4, S-8, F-1, etc.), prospectuses (424B2, 424B4, 424B5, etc.) insider trading reports (Forms 3, 4, 5), proxy statements (DEF 14A), voting records (PRE 14A, N-PX), and any other type. Examples of available exhibits are Exhibit 1 (Underwriting Agreement), Exhibit 8 (Opinion Re Tax Matters), Exhibit 16 (Letter Re Change in Certifying Accountant), Exhibit 21 (Subsidiaries), and all other existing exhibits.

All original file formats and contents are preserved and provided as-is without modifications. Content types include HTML, XML, XSD, XBRL, TXT, PDF, Excel, Word, ZIP, and image files. In addition, HTML, XML, and TXT filings and exhibits can be converted to PDF using the PDF Generator API by supplying the source URL and receiving the generated PDF in response.

Dataset size:
All 20+ million SEC EDGAR filings, and all 100+ million exhibits, and attachments filed since 1993 to present. Includes HTML, TXT, XML, PDF, Excel files, images, and more. Covers all EDGAR form types, such as 10-K, 10-Q, 8-K, S-1, DEF 14A.
Data update frequency:
New filings, exhibits, and attachments are available in less than 600 milliseconds after they are published on EDGAR.
Survivorship bias free:
Yes. All filings, exhibits, and attachments are available from all 800,000+ EDGAR filers, including those that are active and those that have ceased to file.

Use Cases

The Filing Download and PDF Generator APIs are often used alongside the real-time filing Stream API or the pull-based filing Query API. Filings or exhibit URLs pointing to the sec.gov source are typically retrieved from the metadata returned by the Stream or Query API, and these URLs are then used to download the content via the Download API or convert it to PDF using the PDF Generator API. Use cases include:

  • Download historical filings, such as annual reports on Form 10-K, to train LLMs or perform textual analysis
  • Display EDGAR filings in different formats on investor relationship websites
  • Access and monitor specific filing exhibits, such as material contracts, for compliance
  • Download original XBRL files for financial analysis
  • Convert HTML, XML, and TXT filings to PDF for user exports

Download API

Filings, exhibits and attachments can be downloaded by calling the Download API endpoint with the path to the original file on SEC EDGAR. The Download API returns the original file content, such as HTML, XML or TXT.

API Endpoint

https://archive.sec-api.io

Supported HTTP Request Method: GET

New Endpoint (Beta)
https://edgar-mirror.sec-api.io
Rate limit:Up to 200 requests/second (60,000 files per 5-minute interval)
Bandwidth costs:Free during beta for early adopters. Users who join during beta will keep free bandwidth forever.

This endpoint is a drop-in replacement for:

  • the existing Download API. Replace https://archive.sec-api.io with https://edgar-mirror.sec-api.io to access all EDGAR filings, exhibits, and attachments with improved rate limits.
  • the original SEC EDGAR file URLs. Simply replace https://www.sec.gov with https://edgar-mirror.sec-api.io to access the same content with higher rate limits.

The response content type depends on the requested file. For instance, requesting a HTML file returns a text/html MIME content type. The API supports all MIME types, such as text/xml for XML files or images/png for images. By default, transmitted content between the Download API and a client application is compressed with gzip. Typically, the response is automatically decompressed by the client application, such as a browser or a Python/Node.js script. In case of low-level HTTP requests, the decompression needs to be handled by the client application.

Authentication

Two authentication methods are available. Choose the method that best fits your use case:

  • Authorization header: Set the API key as the value of the Authorization header. Do not add "Bearer" or any other words in front of the API key. Example: Authorization: YOUR_API_KEY
  • Query parameter: Set the API key as the token query parameter.
    Example: https://archive.sec-api.io/path/to/edgar-file?token=YOUR_API_KEY. Instead of performing requests to https://archive.sec-api.io/path/to/edgar-file, you always append ?token=YOUR_API_KEY to the end of the URL.

When using the Python or Node.js SDK, the API key is automatically added to the request headers.

Request Parameters

The Download API accepts the file path of the original SEC EDGAR URL. A generic example looks like this:

https://archive.sec-api.io/<cik>/<accession-number>/<filename>

New Endpoint (Beta)

https://edgar-mirror.sec-api.io/<cik>/<accession-number>/<filename>
  • <cik>: The filer's CIK, without leading zeros, e.g. 815094.
  • <accession-number>: The filing's accession number, using only numeric characters (hyphens removed). For example, 000156459021006205 instead of 0001564590-21-006205.
  • <filename>: The name of the file (any file type is supported).

All three values can be obtained from the original file URL and the original file path on SEC EDGAR can always be used directly with the Download API.

Mapping of original EDGAR URL to Download API and new beta endpoint
┌───────────────────────────────────────────────────────────────────────────┐ │ Original EDGAR File URL │ └───────────────────────────────────────────────────────────────────────────┘ https://www.sec.gov/Archives/edgar/data/815094/000156459021006205/abmd-8k_20210211.htm │ │ ▼ ┌───────────────────────────────────────────────────────────────────────────┐ │ Download API URL │ └───────────────────────────────────────────────────────────────────────────┘ https://archive.sec-api.io/815094/000156459021006205/abmd-8k_20210211.htm │ │ ▼ ┌───────────────────────────────────────────────────────────────────────────┐ │ New Endpoint (Beta) │ └───────────────────────────────────────────────────────────────────────────┘ https://edgar-mirror.sec-api.io/815094/000156459021006205/abmd-8k_20210211.htm https://edgar-mirror.sec-api.io/0000815094/000156459021006205/abmd-8k_20210211.htm https://edgar-mirror.sec-api.io/000156459021006205/abmd-8k_20210211.htm https://edgar-mirror.sec-api.io/Archives/edgar/data/815094/000156459021006205/abmd-8k_20210211.htm

Examples

For example, to download the filing with the URL:

        https://www.sec.gov/Archives/edgar/data/815094/000156459021006205/abmd-8k_20210211.htm

The path after data/ is appended to the Download API endpoint like this:

        https://archive.sec-api.io/815094/000156459021006205/abmd-8k_20210211.htm

Similarly, to download the same filing using the new beta endpoint, the URL would be:

        https://edgar-mirror.sec-api.io/815094/000156459021006205/abmd-8k_20210211.htm

Open in Data Browser

PDF Generator API

Download any SEC filing or exhibit as a PDF file.

Since most SEC filings, exhibits and attachments are not published in PDF format, converting the original content is necessary to download them as PDFs. The PDF Generator API offers this functionality by converting HTML, XML, or text-based filings and exhibits into PDFs while preserving the original formatting, including images and tables. The API supports downloading all EDGAR form types as PDFs, including filings and exhibits such as Form 10-K, 10-Q, 8-K, DEF14A, and more, while preserving the original formatting.

Images are optimized and scaled for high-quality printing, such as in proxy statements, and invisible inline XBRL tags are removed to reduce PDF file size and prevent unnecessary bloating. All original content is preserved without alteration. The PDFs are designed to be easily shareable, printable, and suitable for archiving.

Legacy text-based filings (.txt) were not originally designed for PDF-printable output. As a result, single table rows in these older filings may span multiple lines and may not fit within the standard A4 PDF page width. NLP, LLM or RAG-based tasks might encounter difficulties when parsing such files as PDFs. In these cases, it is recommended to use the original text content instead of the PDF version for better accuracy.

API Endpoint

Filings and exhibits can be converted to and downloaded as PDF by calling the following PDF Generator API endpoint with the URL of the original filing or exhibit as a query parameter:

https://api.sec-api.io/filing-reader

Supported HTTP Method: GET

Response content type: application/pdf

The API returns the filing or exhibit as a PDF file, preserving the original formatting, including images and tables.

Request Parameters

  • token (required) - Your API key.
  • url (required) - URL of the filing or exhibit attachement. All file types are supported (HTML, XML, TXT, etc). Must be a valid "sec.gov/Archives" URL. Remove inline XBRL parameters from the URL before using it with the API by replacing /ix?doc= with an empty string.
    Example URLs:
    https://www.sec.gov/Archives/edgar/data/1833764/000089924321006812/xslF345X02/doc3.xml
    https://www.sec.gov/Archives/edgar/data/815094/000156459021006205/abmd-8k_20210211.htm

Examples

Replace YOUR_API_KEY with your actual API key, and copy and paste any of the following example URLs into a browser to download the filing as a PDF.

URL to download a Form 10-K filing as PDF:
    https://api.sec-api.io/filing-reader?
    token=YOUR_API_KEY&
    url=https://www.sec.gov/Archives/edgar/data/320193/000032019323000106/aapl-20230930.htm

URL to download a Form 4 filing in XML format as PDF:
    https://api.sec-api.io/filing-reader?
    token=YOUR_API_KEY&
    url=https://www.sec.gov/Archives/edgar/data/1833764/000089924321006812/xslF345X02/doc3.xml

FAQ

Common questions about querying the Filing Download & PDF Generator API, the response shape, and the bulk archives.

How do I download the original HTML document of a company's annual report once I have its filing URL on SEC's website?

Use the Download API at https://archive.sec-api.io to retrieve the original HTML of a 10-K. Take the filing's primary document URL on EDGAR (the linkToFilingDetails value, for example a URL ending in aapl-20230930.htm), keep everything after /data/, and request that path against the Download API. The endpoint returns the file content unchanged, so a request for an .htm document comes back as text/html exactly as it was published.

The Download API does not transform the document; it serves the same bytes that EDGAR hosts. If you instead want a print-ready version of the same annual report, the PDF Generator API at https://api.sec-api.io/filing-reader converts that HTML document to PDF.

How can I turn a filing's EDGAR web address into a request to the download service?

Take the original EDGAR file URL (the linkToFilingDetails, linkToTxt, or any document URL inside documentFormatFiles) and replace the https://www.sec.gov/Archives/edgar/data prefix with the Download API host https://archive.sec-api.io. In other words, append the path that follows /data/ to https://archive.sec-api.io. For example, the EDGAR URL https://www.sec.gov/Archives/edgar/data/815094/000156459021006205/abmd-8k_20210211.htm becomes https://archive.sec-api.io/815094/000156459021006205/abmd-8k_20210211.htm.

The path that follows /data/ always consists of the filer CIK, the accession number without hyphens, and the file name. The original EDGAR file path can always be used directly with the Download API in this way.

What is the fastest way to download a filing if I only have its company identifier, accession number, and file name?

The Download API at https://archive.sec-api.io accepts the three identifiers directly in the path, in the form https://archive.sec-api.io/<cik>/<accession-number>/<filename>. The <cik> is the filer's CIK without leading zeros (for example 815094, drawn from the cik field), the <accession-number> is the accession number with all hyphens removed (for example 000156459021006205 rather than 0001564590-21-006205, derived from the accessionNo field), and <filename> is the name of the document you want.

No other lookup step is needed: assembling those three values into the path is enough to retrieve the original file. The new beta endpoint https://edgar-mirror.sec-api.io accepts the same path structure if you want higher throughput.

How do I retrieve the complete submission text file for a filing rather than just one of its documents?

Each filing has a complete submission text file that bundles every document, exhibit, and the SGML header into a single .txt file. Its URL is stored in the linkToTxt field (for example https://www.sec.gov/Archives/edgar/data/19617/000121390021012092/0001213900-21-012092.txt), and the same file also appears in documentFormatFiles as the entry whose description is Complete submission text file.

To download it, take that linkToTxt URL and request it through the Download API at https://archive.sec-api.io by replacing the https://www.sec.gov/Archives/edgar/data prefix with the Download API host. The endpoint returns the full submission text rather than an individual rendered document.

How can I download a single exhibit, such as a material contract or list of subsidiaries, attached to a filing?

Individual exhibits are listed in the documentFormatFiles array, each with its own document URL (documentFormatFiles.documentUrl) and an exhibit type (documentFormatFiles.type) such as EX-99.1 for an exhibit attachment. A material contract is filed under Exhibit 10, an underwriting agreement under Exhibit 1, and a list of subsidiaries under Exhibit 21. To download one specific exhibit, take its documentUrl and request it through the Download API at https://archive.sec-api.io by replacing the https://www.sec.gov/Archives/edgar/data prefix with the Download API host.

The Download API serves each exhibit as its own file, so you retrieve only the attachment you ask for rather than the whole submission. This is the approach for monitoring specific exhibits, for example tracking material contracts for compliance.

How do I convert an insider trading report into a PDF for sharing with my team?

Use the PDF Generator API at https://api.sec-api.io/filing-reader to convert a Form 3, 4, or 5 insider trading report into a PDF. The endpoint takes the URL of the original filing document and returns the rendered file with a content type of application/pdf, preserving the original formatting including tables and images.

Insider reports are typically stored as XML, so use the document URL from linkToFilingDetails or the matching documentFormatFiles entry. If that URL points at the inline XBRL viewer (it contains /ix?doc=), remove /ix?doc= from the URL before passing it to the PDF Generator API. The resulting PDF is suitable for sharing, printing, and archiving.

What endpoint do I use to generate a printable PDF of a 10-K filing, and what parameters does it require?

The PDF Generator API endpoint https://api.sec-api.io/filing-reader produces a printable PDF of a 10-K. It is a GET-only endpoint and takes two required values: token, which is your API key, and url, which is the address of the original filing document on EDGAR (a valid sec.gov/Archives URL, such as the 10-K's linkToFilingDetails value).

The response content type is application/pdf, and the original layout, including tables and images, is preserved. Invisible inline XBRL tags are stripped out so the resulting PDF stays smaller. If the url you have contains the inline XBRL viewer segment /ix?doc=, remove that segment before using it.

How do I download an XBRL financial data file from a filing so I can run my own financial analysis?

XBRL and other structured data files are listed in the dataFiles array of a filing, and when a filing carries XBRL the linkToXbrl field holds the address of the XBRL document. To download an XBRL file, take that URL and request it through the Download API at https://archive.sec-api.io by replacing the https://www.sec.gov/Archives/edgar/data prefix with the Download API host.

The Download API serves XBRL, XSD, and other data files in their original format without modification, so the file is ready for parsing into your own financial analysis. Note that not every filing has XBRL attached; in those cases linkToXbrl is empty and dataFiles is an empty array.

Can I download filing images, such as graphics embedded in a prospectus, and how?

Yes. Embedded images appear in the documentFormatFiles array as separate entries whose type is GRAPHIC (for example a .jpg file like image_001.jpg attached to a prospectus). Each one has its own document URL in documentFormatFiles.documentUrl. To download an image, take that URL and request it through the Download API at https://archive.sec-api.io by replacing the https://www.sec.gov/Archives/edgar/data prefix with the Download API host.

The Download API supports all MIME types and returns the image with the matching content type, such as image/png or the original JPEG, so the graphic comes back exactly as it was filed.

How do I authenticate my requests to the download service without putting my key in the URL?

Authenticate to the Download API at https://archive.sec-api.io by setting your API key as the value of the Authorization header. The key is used directly as the header value with no prefix; do not add the word Bearer or any other text in front of it.

This header-based method keeps the API key out of the URL, which is useful when you do not want the key recorded in logs or browser history. When you use the official Python or Node.js SDK, the key is added to the request headers for you automatically.

How do I pass my API key as part of the URL when downloading a filing?

The Download API at https://archive.sec-api.io accepts the API key as the token query parameter appended to the request URL, for example https://archive.sec-api.io/path/to/edgar-file?token=YOUR_API_KEY. Whenever you would request a file path, you add ?token=YOUR_API_KEY to the end of that URL.

This is the alternative to passing the key in the Authorization header, and it is convenient when you want to open a download link directly in a browser. The PDF Generator API at https://api.sec-api.io/filing-reader also uses a token parameter for the same purpose.

When a filing URL contains inline XBRL viewer parameters, how do I clean it up before requesting a PDF?

When an EDGAR URL points at the inline XBRL viewer it contains the segment /ix?doc=, for example https://www.sec.gov/Archives/edgar/data/.../ix?doc=/Archives/edgar/data/.../doc.htm. Before passing such a URL to the PDF Generator API at https://api.sec-api.io/filing-reader, remove the /ix?doc= segment so the url value points directly at the underlying document.

After that cleanup the url is a plain sec.gov/Archives document address, which is the form the PDF Generator API requires. The endpoint then renders the document itself rather than the viewer wrapper.

How quickly can I access a newly published EDGAR filing through the download service after it appears on SEC's website?

New EDGAR files, including filings, exhibits, and attachments, become accessible through the Download API at https://archive.sec-api.io in approximately 300 milliseconds after they are published on EDGAR, and in all cases in less than 600 milliseconds.

This applies to any new document; once a filing is live on EDGAR you can request its path against the Download API almost immediately by replacing the https://www.sec.gov/Archives/edgar/data prefix with the Download API host.

How many filings can I download in a short window before hitting rate limits, and what is the per-second cap?

The Download API supports up to 60,000 downloads per API key within a five-minute window. The standard endpoint https://archive.sec-api.io is rated at 50 requests per second, while the original EDGAR file URLs are limited to 10 requests per second.

The new beta endpoint https://edgar-mirror.sec-api.io raises the per-second cap to 200 requests per second, still within the same 60,000-files-per-five-minute allowance. If you need throughput beyond a single client's pace, the beta endpoint has an overall capacity of more than one million requests per second.

Which beta endpoint gives the highest throughput for bulk downloading filings, and how does it differ from the standard one?

The beta endpoint https://edgar-mirror.sec-api.io is the higher-throughput option for bulk downloads. It is a drop-in replacement for the standard Download API at https://archive.sec-api.io: you simply swap the host and keep the same <cik>/<accession-number>/<filename> path structure.

The difference is in capacity and rate limits. The standard endpoint is rated at 50 requests per second, while the beta endpoint allows up to 200 requests per second and has an overall capacity of more than one million requests per second. The beta endpoint also accepts more path variants, including CIKs with leading zeros and the full Archives/edgar/data/... path. During the beta, bandwidth is free for early adopters.

How do I download a filing using the original SEC web address with only the domain swapped out?

The beta endpoint https://edgar-mirror.sec-api.io works as a direct replacement for the SEC host. Take any original EDGAR file URL and replace https://www.sec.gov with https://edgar-mirror.sec-api.io, leaving the rest of the path unchanged. For example, https://www.sec.gov/Archives/edgar/data/815094/000156459021006205/abmd-8k_20210211.htm becomes https://edgar-mirror.sec-api.io/Archives/edgar/data/815094/000156459021006205/abmd-8k_20210211.htm.

This returns the same content as the SEC site but with higher rate limits. The beta endpoint also accepts the shorter <cik>/<accession-number>/<filename> path form if you prefer not to keep the full Archives/edgar/data prefix.

Can I look up and download filings from companies that no longer exist or have stopped filing?

Yes. The Download API at https://archive.sec-api.io is survivorship-bias free: it serves filings, exhibits, and attachments from all 800,000-plus EDGAR filers, including companies that have ceased to file as well as those still active.

As long as you have the filer CIK, accession number, and file name (the cik and accessionNo values plus a document URL from documentFormatFiles), you can request the file regardless of whether the company is still in operation. Filings of acquired, delisted, or dissolved entities remain available.

How far back in time does the download service let me retrieve historical filings?

The Download API at https://archive.sec-api.io covers all EDGAR filings from 1993 and 1994 through the present, spanning more than 20 million filings and more than 100 million exhibits and attachments across all 400-plus EDGAR form types.

Historical documents are served the same way as recent ones: take the original EDGAR URL and replace the https://www.sec.gov/Archives/edgar/data prefix with the Download API host. Older legacy filings from the 1990s are available, though they were filed as plain text rather than HTML.

I want to bulk download thousands of 10-K filings to train a language model — how should I structure those download requests?

For large-scale 10-K downloads, use the beta endpoint https://edgar-mirror.sec-api.io, which is the higher-throughput option, rated at up to 200 requests per second within an allowance of 60,000 files per five-minute window. Each request follows the path form https://edgar-mirror.sec-api.io/<cik>/<accession-number>/<filename>, where the values come from each filing's cik, accessionNo (hyphens removed), and a document URL in documentFormatFiles.

The Download API itself only retrieves files; you first need the list of 10-K document URLs to fetch. Those are obtained from the filing metadata returned by the pull-based filing Query API at /full-text-search or the real-time Stream API, which provide the linkToFilingDetails and documentFormatFiles entries. You then iterate over those URLs against the beta endpoint. For training a language model on filing text, request the original HTML or text document rather than the PDF version.

How do I download the raw text version of an older legacy filing that predates HTML formatting?

Legacy filings from the early years of EDGAR were submitted as plain .txt documents rather than HTML. The text document is reachable through the linkToTxt field or the corresponding .txt entry in documentFormatFiles. To download it, take that URL and request it through the Download API at https://archive.sec-api.io by replacing the https://www.sec.gov/Archives/edgar/data prefix with the Download API host.

The endpoint returns the file with a text/plain content type, unchanged from how it was filed. For text analysis, NLP, or RAG tasks on these older filings, the raw text content is preferred over a converted PDF.

For a filing that has several attached documents, how do I know which file is the main document versus a supporting exhibit?

The documentFormatFiles array lists every document in a submission, and each entry carries a documentFormatFiles.sequence number and a documentFormatFiles.type. The primary filing is the entry with sequence 1 whose type matches the form type itself (for example type 8-K for an 8-K, or SC14D9C for that form), and its URL also matches the filing's linkToFilingDetails. Supporting exhibits carry types such as EX-99.1 or GRAPHIC, and the bundled submission file is the entry whose description is Complete submission text file.

Once you have identified the entry you want, take its documentFormatFiles.documentUrl and request it through the Download API at https://archive.sec-api.io by replacing the https://www.sec.gov/Archives/edgar/data prefix with the Download API host.

How do I generate PDFs of proxy statements while keeping their tables and images intact?

Use the PDF Generator API at https://api.sec-api.io/filing-reader to render a proxy statement (Form DEF 14A) as a PDF. The endpoint converts the HTML document while preserving the original formatting, including tables and images, and it optimizes and scales embedded images for high-quality printing such as the graphics common in proxy statements.

Provide the proxy statement's document URL from linkToFilingDetails as the url value and your API key as token. The response comes back with a content type of application/pdf. Invisible inline XBRL tags are removed during conversion so the resulting PDF stays compact.

Why might a PDF of an old text-based filing look misaligned, and what should I use instead for text analysis?

Legacy text-based .txt filings were never designed for printable page output. When the PDF Generator API at https://api.sec-api.io/filing-reader converts one, a single table row can span multiple lines and may not fit within the standard A4 page width, so the result can look misaligned.

For NLP, LLM, or RAG-based tasks on these older filings, use the original text content instead of the PDF version. Retrieve that text by taking the filing's linkToTxt URL and requesting it through the Download API at https://archive.sec-api.io, which gives better accuracy for parsing.

What content type does the download service return, and how is the response compressed?

The Download API at https://archive.sec-api.io returns each file with a MIME content type that matches the requested file. An HTML document comes back as text/html, an XML document as text/xml, an image as a type such as image/png, and so on across HTML, XML, XSD, XBRL, TXT, PDF, Excel, Word, ZIP, and image files.

By default the response body is compressed with gzip. Most clients, such as browsers and standard Python or Node.js HTTP libraries, decompress the response automatically. If you use a low-level HTTP client, your application has to handle the gzip decompression itself.

How do I download a Form 4 filing that is stored as an XML document rather than HTML?

Form 4 insider trading reports are filed as XML documents. The XML file is listed in documentFormatFiles with a type of 4, and its address is also the filing's linkToFilingDetails value (for example a URL ending in doc1.xml or wf-form4_155088062561750.xml). To download it, take that URL and request it through the Download API at https://archive.sec-api.io by replacing the https://www.sec.gov/Archives/edgar/data prefix with the Download API host.

The endpoint returns the XML with a text/xml content type, unchanged. Note that EDGAR also publishes a styled version of the same document under an xslF345X03/ path; request the plain XML URL if you want the raw machine-readable form. To get the Form 4 as a PDF instead, pass that XML URL to the PDF Generator API at https://api.sec-api.io/filing-reader.

How can I retrieve an SEC-generated comment or response letter associated with a company's filing history?

SEC-generated correspondence appears in EDGAR as an UPLOAD submission with a description of Form UPLOAD - SEC-generated letter and a formType of LETTER. Its document is reachable through linkToFilingDetails (for these letters often a .pdf such as filename1.pdf) and is also listed in documentFormatFiles with a type of LETTER. To download it, take that document URL and request it through the Download API at https://archive.sec-api.io by replacing the https://www.sec.gov/Archives/edgar/data prefix with the Download API host.

The Download API serves these letters in their original format, so a .pdf letter comes back as application/pdf. The accompanying text extract, when present, is another documentFormatFiles entry with a type such as TEXT-EXTRACT.

When a filing is submitted jointly, the entities array lists every related filer, each with its own CIK and file number, but the submission has a single set of documents in documentFormatFiles. There is one shared accession number (accessionNo) and one primary document at linkToFilingDetails. To download that shared document, take its URL and request it through the Download API at https://archive.sec-api.io by replacing the https://www.sec.gov/Archives/edgar/data prefix with the Download API host.

You do not need a separate request per entity; the document URL is the same for all of them. The CIK embedded in the document path is the filing agent's path CIK, and the same file serves the whole group of joint filers.

Is there a way to display original EDGAR filings on my investor relations website by fetching them on demand?

Yes. The Download API at https://archive.sec-api.io can fetch original EDGAR filings on demand so they can be displayed on an investor relations website. Take the document URL from a filing's linkToFilingDetails or documentFormatFiles, replace the https://www.sec.gov/Archives/edgar/data prefix with the Download API host, and serve the returned content, which preserves the original HTML, XML, or text.

If you want to present filings as PDFs instead, the PDF Generator API at https://api.sec-api.io/filing-reader converts the same documents to application/pdf. Displaying EDGAR filings in different formats on investor relations sites is one of the listed use cases for these endpoints.

How do I download a pricing supplement or prospectus document filed under a registration statement?

Prospectus and pricing supplement documents are filed under form types in the 424B family (such as 424B2, 424B3, 424B4, 424B5) tied to a registration statement. The primary document is at linkToFilingDetails and is listed in documentFormatFiles with a type matching the form, for example 424B2 with a description of PRICING SUPPLEMENT. To download it, take that URL and request it through the Download API at https://archive.sec-api.io by replacing the https://www.sec.gov/Archives/edgar/data prefix with the Download API host.

The endpoint returns the document in its original format. To produce a PDF of the prospectus instead, pass that document URL to the PDF Generator API at https://api.sec-api.io/filing-reader, which keeps tables and images intact.

What request method should I use to call the download and PDF endpoints, and are POST requests supported?

Both endpoints are GET only. The Download API at https://archive.sec-api.io (and its beta replacement https://edgar-mirror.sec-api.io) supports the GET HTTP method, and the PDF Generator API at https://api.sec-api.io/filing-reader also supports only GET.

POST requests are not supported by either endpoint. Each request is fully expressed in the URL: a file path for the Download API, and the token and url query parameters for the PDF Generator API.