Download And PDF Generated

Access and download any filing, exhibits, or attachments, including HTML, XML, XSD, graphics, or plain TXT data from the SEC EDGAR database. The Render & Download API endpoint provides access to the original content of any filing, exhibit, and attachment. This API supports bulk downloading of filings, making it convenient for building local databases of specific filing types. The Download API allows more than 40 requests per second per API key, enabling the download of over 40 filings per second.

Dataset Size: All SEC EDGAR filings, exhibits, and attachments filed since 1993.

Data Update Frequency: Less than 300 milliseconds.

API Endpoint

POST https://api.secfilingdata.com/v1/filings/generate-and-downlaod-pdf/

Supported HTTP methods: GET

Authentication

All requests require an API token in the Authorization header.

Authorization: AUTH_TOKEN

Request Parameters

Parameter Type Required Description
url string Required The url of the filing.

Request Example

{
  "url": "https://www.sec.gov/Archives/edgar/data/1318605/000156459021004599/tsla-10k_20201231_htm.xml"
}

Response

<?php

$apiUrl = "https://api.secfilingdata.com/v1/filings/generate-and-downlaod-pdf";
$authToken = "YOUR_API_TOKEN";

$postData = [
    'url' => 'https://www.sec.gov/Archives/edgar/data/1833764/000089924321006812/xslF345X02/doc3.xml'
];

// Generate PDF
$ch = curl_init($apiUrl);

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => json_encode($postData),
    CURLOPT_HTTPHEADER => [
        "Authorization: {$authToken}",
        "Content-Type: application/json"
    ]
]);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    die(curl_error($ch));
}

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

if ($httpCode !== 200) {
    die("API Error: HTTP {$httpCode}");
}

$data = json_decode($response, true);

if (empty($data['status'])) {
    die("PDF generation failed.");
}

// Download PDF
$pdfUrl = $data['pdf_url'];

$saveFolder = __DIR__ . '/generated-pdf';

if (!is_dir($saveFolder)) {
    mkdir($saveFolder, 0777, true);
}

$savePath = $saveFolder . '/' . $data['fileName'];

$file = fopen($savePath, 'w');

$ch = curl_init($pdfUrl);

curl_setopt_array($ch, [
    CURLOPT_FILE => $file,
    CURLOPT_FOLLOWLOCATION => true
]);

curl_exec($ch);
curl_close($ch);
fclose($file);

echo "PDF saved successfully:\n";
echo $savePath;
import os
import requests

api_url = "https://api.secfilingdata.com/v1/filings/generate-and-downlaod-pdf"

headers = {
    "Authorization": "YOUR_API_TOKEN",
    "Content-Type": "application/json"
}

payload = {
    "url": "https://www.sec.gov/Archives/edgar/data/1833764/000089924321006812/xslF345X02/doc3.xml"
}

response = requests.post(api_url, json=payload, headers=headers)
response.raise_for_status()

data = response.json()

if not data.get("status"):
    raise Exception("PDF generation failed.")

pdf_response = requests.get(data["pdf_url"], stream=True)
pdf_response.raise_for_status()

os.makedirs("generated-pdf", exist_ok=True)

save_path = os.path.join("generated-pdf", data["fileName"])

with open(save_path, "wb") as file:
    for chunk in pdf_response.iter_content(8192):
        file.write(chunk)

print(f"PDF saved successfully: {save_path}")
const apiUrl = "https://api.secfilingdata.com/v1/filings/generate-and-downlaod-pdf";

fetch(apiUrl, {
    method: "POST",
    headers: {
        "Authorization": "YOUR_API_TOKEN",
        "Content-Type": "application/json"
    },
    body: JSON.stringify({
        url: "https://www.sec.gov/Archives/edgar/data/1833764/000089924321006812/xslF345X02/doc3.xml"
    })
})
.then(res => res.json())
.then(data => {
    if (!data.status) {
        throw new Error("PDF generation failed.");
    }

    const link = document.createElement("a");
    link.href = data.pdf_url;
    link.download = data.fileName;
    document.body.appendChild(link);
    link.click();
    link.remove();
})
.catch(console.error);
const axios = require("axios");
const fs = require("fs");

(async () => {

    const response = await axios.post(
        "https://api.secfilingdata.com/v1/filings/generate-and-downlaod-pdf",
        {
            url: "https://www.sec.gov/Archives/edgar/data/1833764/000089924321006812/xslF345X02/doc3.xml"
        },
        {
            headers: {
                Authorization: "YOUR_API_TOKEN"
            }
        }
    );

    if (!response.data.status) {
        throw new Error("PDF generation failed.");
    }

    fs.mkdirSync("generated-pdf", { recursive: true });

    const writer = fs.createWriteStream(
        `generated-pdf/${response.data.fileName}`
    );

    const pdf = await axios({
        url: response.data.pdf_url,
        method: "GET",
        responseType: "stream"
    });

    pdf.data.pipe(writer);

    writer.on("finish", () => {
        console.log("PDF saved successfully.");
    });

})();
curl -X POST "https://api.secfilingdata.com/v1/filings/generate-and-downlaod-pdf" \
-H "Authorization: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
  "url":"https://www.sec.gov/Archives/edgar/data/1833764/000089924321006812/xslF345X02/doc3.xml"
}'
package main

import (
    "encoding/json"
    "io"
    "net/http"
    "os"
    "strings"
)

type Response struct {
    Status   bool   `json:"status"`
    PdfURL   string `json:"pdf_url"`
    FileName string `json:"fileName"`
}

func main() {

    payload := `{
        "url":"https://www.sec.gov/Archives/edgar/data/1833764/000089924321006812/xslF345X02/doc3.xml"
    }`

    req, _ := http.NewRequest(
        "POST",
        "https://api.secfilingdata.com/v1/filings/generate-and-downlaod-pdf",
        strings.NewReader(payload),
    )

    req.Header.Set("Authorization", "YOUR_API_TOKEN")
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}

    res, _ := client.Do(req)
    defer res.Body.Close()

    var result Response

    json.NewDecoder(res.Body).Decode(&result)

    if !result.Status {
        panic("PDF generation failed")
    }

    os.MkdirAll("generated-pdf", 0755)

    file, _ := os.Create("generated-pdf/" + result.FileName)
    defer file.Close()

    pdfRes, _ := http.Get(result.PdfURL)
    defer pdfRes.Body.Close()

    io.Copy(file, pdfRes.Body)
}
import java.net.URI;
import java.net.http.*;
import java.nio.file.*;

public class Main {

    public static void main(String[] args) throws Exception {

        HttpClient client = HttpClient.newHttpClient();

        String json = """
        {
            "url":"https://www.sec.gov/Archives/edgar/data/1833764/000089924321006812/xslF345X02/doc3.xml"
        }
        """;

        HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create("https://api.secfilingdata.com/v1/filings/generate-and-downlaod-pdf"))
                .header("Authorization", "YOUR_API_TOKEN")
                .header("Content-Type", "application/json")
                .POST(HttpRequest.BodyPublishers.ofString(json))
                .build();

        HttpResponse response =
                client.send(request, HttpResponse.BodyHandlers.ofString());

        System.out.println(response.body());

        // Parse the JSON response to obtain pdf_url and download it if needed.
    }
}
using System;
using System.IO;
using System.Net.Http;
using System.Text;
using System.Text.Json;

class Program
{
    static async System.Threading.Tasks.Task Main()
    {
        using var client = new HttpClient();

        client.DefaultRequestHeaders.Add("Authorization", "YOUR_API_TOKEN");

        var json = @"{
            ""url"":""https://www.sec.gov/Archives/edgar/data/1833764/000089924321006812/xslF345X02/doc3.xml""
        }";

        var response = await client.PostAsync(
            "https://api.secfilingdata.com/v1/filings/generate-and-downlaod-pdf",
            new StringContent(json, Encoding.UTF8, "application/json")
        );

        var body = await response.Content.ReadAsStringAsync();

        var data = JsonDocument.Parse(body).RootElement;

        if (!data.GetProperty("status").GetBoolean())
            throw new Exception("PDF generation failed.");

        var pdfUrl = data.GetProperty("pdf_url").GetString();
        var fileName = data.GetProperty("fileName").GetString();

        Directory.CreateDirectory("generated-pdf");

        var bytes = await client.GetByteArrayAsync(pdfUrl);

        await File.WriteAllBytesAsync(
            Path.Combine("generated-pdf", fileName),
            bytes
        );

        Console.WriteLine("PDF saved successfully.");
    }
}
require "net/http"
require "json"
require "fileutils"
require "open-uri"

uri = URI("https://api.secfilingdata.com/v1/filings/generate-and-downlaod-pdf")

request = Net::HTTP::Post.new(uri)
request["Authorization"] = "YOUR_API_TOKEN"
request["Content-Type"] = "application/json"

request.body = {
  url: "https://www.sec.gov/Archives/edgar/data/1833764/000089924321006812/xslF345X02/doc3.xml"
}.to_json

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

data = JSON.parse(response.body)

abort("PDF generation failed.") unless data["status"]

FileUtils.mkdir_p("generated-pdf")

URI.open(data["pdf_url"]) do |pdf|
  File.open("generated-pdf/#{data['fileName']}", "wb") do |file|
    file.write(pdf.read)
  end
end

puts "PDF saved successfully."