sec-api.ioSEC API by D2V
FilingsPricingSandboxDocs
Log inGet Free API Key
API Documentation
Introduction

Filing Query API
Full-Text Search API
Stream API
Download & PDF Generator API
XBRL-to-JSON Converter 
Extractor API 

Form ADV API - Investment Advisers

Form 3/4/5 API - Insider Trading
Form 144 API - Restricted Sales
Form 13F API - Institut. Holdings
Overview
Example: Python
Form 13D/13G API - Activist Invst.
Form N-PORT API - Mutual Funds

Form N-CEN API - Annual Reports
Form N-PX API - Proxy Voting

Form S-1/424B4 API - IPOs, Notes
Form C API - Crowdfunding
Form D API - Private Sec. Offerings
Form 1-A/1-K/1-Z - Reg A Offerings

Form 8-K API - Item 4.01
Form 8-K API - Item 4.02
Form 8-K API - Item 5.02

Executive Compensation API
Directors & Board Members
Company Subsidiaries
Outstanding Shares & Public Float

SEC Enforcement Actions
SEC Litigation Releases
SEC Administrative Proceedings
AAER Database API
SRO Filings Database

CIK, CUSIP, Ticker Mapping API
EDGAR Entities Database

Financial Statements

Access Portfolio Holdings & Cover Pages of Form 13F Filings with Python

Open In Colab   Download Notebook

On this page:
  • Quick Start
    • Holdings from Form 13F Filings
      • Cover Pages from Form 13F Filings

      This Python tutorial demonstrates how to access and download the holdings and cover pages of Form 13F filings using the sec-api Python package and the Form 13F APIs. The number of unique holdings of a fund is calculated as well as the total portfolio value. The cover page of the corresponding Form 13F filing is also downloaded, allowing for confirmation of the fund's name, address, other managers, and more.

      Quick Start

      !pip install sec-api
      import json
      import pandas as pd

      API_KEY_SEC_API = "YOUR_API_KEY"
      from sec_api import Form13FHoldingsApi, Form13FCoverPagesApi

      form13FHoldingsApi = Form13FHoldingsApi(API_KEY_SEC_API)
      form13FCoverPagesApi = Form13FCoverPagesApi(API_KEY_SEC_API)

      search_params = {
          "query": "cik:1350694 AND periodOfReport:2024-03-31",
          "from": "0",
          "size": "1",
          "sort": [{"periodOfReport": {"order": "desc"}}],
      }

      # load holdings
      response = form13FHoldingsApi.get_data(search_params)
      filings = response["data"]
      holdings = filings[0]["holdings"]

      # load cover page
      response = form13FCoverPagesApi.get_data(search_params)
      cover_page = response["data"][0]

      Holdings from Form 13F Filings

      The following example demonstrates how to retrieve a fund's holdings from Form 13F filings. The get_data(search_params) method of the Form13FHoldingsApi class extracts holdings from Form 13F filings that match the specified search criteria. In this example, we obtain the portfolio holdings of Bridgewater Associates (CIK: 1350694) as reported in their 13F filing for the first quarter of 2024.

      from sec_api import Form13FHoldingsApi

      form13FHoldingsApi = Form13FHoldingsApi(API_KEY_SEC_API)

      search_params = {
          "query": "cik:1350694 AND periodOfReport:2024-03-31",
          "from": "0",
          "size": "1",
          "sort": [{"periodOfReport": {"order": "desc"}}],
      }

      response = form13FHoldingsApi.get_data(search_params)
      filings = response["data"]
      holdings_json = filings[0]["holdings"]
      holdings = pd.DataFrame(holdings_json)
      holdings
      Out[5]:
      cusiptickercikinvestmentDiscretionvotingAuthoritynameOfIssuervalueshrsOrPrnAmttitleOfClass
      088579Y101MMM66740SOLE{'Sole': 13726, 'Shared': 0, 'None': 0}3M CO1455917{'sshPrnamtType': 'SH', 'sshPrnamt': 13726}COM
      1002824100ABT1800SOLE{'Sole': 1728482, 'Shared': 0, 'None': 7675}ABBOTT LABS197331605{'sshPrnamtType': 'SH', 'sshPrnamt': 1736157}COM
      200287Y109ABBV1551152SOLE{'Sole': 449779, 'Shared': 0, 'None': 0}ABBVIE INC81904756{'sshPrnamtType': 'SH', 'sshPrnamt': 449779}COM
      300404A109ACHC1520697SOLE{'Sole': 82943, 'Shared': 0, 'None': 408}ACADIA HEALTHCARE COMPANY IN6603066{'sshPrnamtType': 'SH', 'sshPrnamt': 83351}COM
      4G1151C101ACN1467373SOLE{'Sole': 5269, 'Shared': 0, 'None': 0}ACCENTURE PLC IRELAND1826288{'sshPrnamtType': 'SH', 'sshPrnamt': 5269}SHS CLASS A
      ..............................
      67298954M200Z1617640SOLE{'Sole': 98269, 'Shared': 0, 'None': 0}ZILLOW GROUP INC4793562{'sshPrnamtType': 'SH', 'sshPrnamt': 98269}CL C CAP STK
      67398956P102ZBH1136869SOLE{'Sole': 353985, 'Shared': 0, 'None': 918}ZIMMER BIOMET HOLDINGS INC46840098{'sshPrnamtType': 'SH', 'sshPrnamt': 354903}COM
      67498978V103ZTS1555280SOLE{'Sole': 60434, 'Shared': 0, 'None': 0}ZOETIS INC10226037{'sshPrnamtType': 'SH', 'sshPrnamt': 60434}CL A
      67598980F104ZI1794515SOLE{'Sole': 70792, 'Shared': 0, 'None': 0}ZOOMINFO TECHNOLOGIES INC1134796{'sshPrnamtType': 'SH', 'sshPrnamt': 70792}COMMON STOCK
      67698980A105ZTO1677250SOLE{'Sole': 523693, 'Shared': 0, 'None': 0}ZTO EXPRESS CAYMAN INC10966131{'sshPrnamtType': 'SH', 'sshPrnamt': 523693}SPONSORED ADS A

      677 rows × 9 columns

      columns_to_explode = ["votingAuthority", "shrsOrPrnAmt"]

      for column in columns_to_explode:
          holdings = pd.concat(
              [
                  holdings.drop(columns=column),
                  pd.json_normalize(holdings[column]).add_prefix(f"{column}_"),
              ],
              axis=1,
          )

      holdings
      Out[6]:
      cusiptickercikinvestmentDiscretionnameOfIssuervaluetitleOfClassvotingAuthority_SolevotingAuthority_SharedvotingAuthority_NoneshrsOrPrnAmt_sshPrnamtTypeshrsOrPrnAmt_sshPrnamt
      088579Y101MMM66740SOLE3M CO1455917COM1372600SH13726
      1002824100ABT1800SOLEABBOTT LABS197331605COM172848207675SH1736157
      200287Y109ABBV1551152SOLEABBVIE INC81904756COM44977900SH449779
      300404A109ACHC1520697SOLEACADIA HEALTHCARE COMPANY IN6603066COM829430408SH83351
      4G1151C101ACN1467373SOLEACCENTURE PLC IRELAND1826288SHS CLASS A526900SH5269
      .......................................
      67298954M200Z1617640SOLEZILLOW GROUP INC4793562CL C CAP STK9826900SH98269
      67398956P102ZBH1136869SOLEZIMMER BIOMET HOLDINGS INC46840098COM3539850918SH354903
      67498978V103ZTS1555280SOLEZOETIS INC10226037CL A6043400SH60434
      67598980F104ZI1794515SOLEZOOMINFO TECHNOLOGIES INC1134796COMMON STOCK7079200SH70792
      67698980A105ZTO1677250SOLEZTO EXPRESS CAYMAN INC10966131SPONSORED ADS A52369300SH523693

      677 rows × 12 columns

      unique_holdings_by_cusip = holdings.groupby("cusip").first().reset_index()
      print(f"Number of unique holdings: {len(unique_holdings_by_cusip)}")
      Number of unique holdings: 677
      total_portfolio_value = holdings["value"].sum() / 1_000_000_000
      print(f"Total portfolio value: ${total_portfolio_value:,.3f} billion")
      Total portfolio value: $19.775 billion

      Cover Pages from Form 13F Filings

      To retrieve the cover page of Bridgewater's Form 13F filing for the first quarter of 2024, we use the get_data(search_params) method of the Form13FCoverPagesApi class.

      from sec_api import Form13FCoverPagesApi

      form13FCoverPagesApi = Form13FCoverPagesApi(API_KEY_SEC_API)

      search_params = {
          "query": "cik:1350694 AND periodOfReport:2024-03-31",
          "from": "0",
          "size": "1",
          "sort": [{"periodOfReport": {"order": "desc"}}],
      }

      response = form13FCoverPagesApi.get_data(search_params)
      cover_page = response["data"][0]

      print(json.dumps(cover_page, indent=2))
      {
        "id": "d1a4cbcd2eab004e9415e402a2701c46",
        "accessionNo": "0001172661-24-002257",
        "filedAt": "2024-05-14T12:37:20-04:00",
        "formType": "13F-HR",
        "cik": "1350694",
        "crdNumber": "105129",
        "secFileNumber": "801-35875",
        "form13FFileNumber": "028-11794",
        "periodOfReport": "2024-03-31",
        "isAmendment": false,
        "amendmentInfo": {},
        "filingManager": {
          "name": "Bridgewater Associates, LP",
          "address": {
            "street": "One Nyala Farms Road",
            "city": "Westport",
            "stateOrCountry": "CT",
            "zipCode": 6880
          }
        },
        "reportType": "13F HOLDINGS REPORT",
        "otherManagersReportingForThisManager": [],
        "provideInfoForInstruction5": false,
        "signature": {
          "name": "Michael Kitson",
          "title": "Chief Compliance Officer and Counsel",
          "phone": "203-226-3030",
          "signature": "Michael Kitson",
          "city": "Westport",
          "stateOrCountry": "CT",
          "signatureDate": "05-14-2024"
        },
        "tableEntryTotal": 677,
        "tableEntryTotalAsReported": 677,
        "tableValueTotal": 19775432137,
        "tableValueTotalAsReported": 19775432137,
        "otherIncludedManagersCount": 0,
        "otherIncludedManagers": []
      }

      Footer

      Products

      • EDGAR Filing Search API
      • Full-Text Search API
      • Real-Time Filing Stream API
      • Filing Download & PDF Generator API
      • XBRL-to-JSON Converter
      • 10-K/10-Q/8-K Item Extractor
      • Investment Adviser & Form ADV API
      • Insider Trading Data - Form 3, 4, 5
      • Restricted Sales Notifications - Form 144
      • Institutional Holdings - Form 13F
      • Form N-PORT API - Investment Company Holdings
      • Form N-CEN API - Annual Reports by Investment Companies
      • Form N-PX API - Proxy Voting Records
      • Form 13D/13G API
      • Form S-1/424B4 - IPOs, Debt & Rights Offerings
      • Form C - Crowdfunding Offerings
      • Form D - Private Placements & Exempt Offerings
      • Regulation A Offering Statements API
      • Changes in Auditors & Accountants
      • Non-Reliance on Prior Financial Statements
      • Executive Compensation Data API
      • Directors & Board Members Data
      • Company Subsidiaries Database
      • Outstanding Shares & Public Float
      • SEC Enforcement Actions
      • Accounting & Auditing Enforcement Releases (AAERs)
      • SRO Filings
      • CIK, CUSIP, Ticker Mapping

      General

      • Pricing
      • Features
      • Supported Filings
      • EDGAR Filing Statistics

      Account

      • Sign Up - Start Free Trial
      • Log In
      • Forgot Password

      Developers

      • API Sandbox
      • Documentation
      • Resources & Tutorials
      • Python API SDK
      • Node.js API SDK

      Legal

      • Terms of Service
      • Privacy Policy

      Legal

      • Terms of Service
      • Privacy Policy

      SEC API

      © 2025 sec-api.io by Data2Value GmbH. All rights reserved.

      SEC® and EDGAR® are registered trademarks of the U.S. Securities and Exchange Commission (SEC).

      EDGAR is the Electronic Data Gathering, Analysis, and Retrieval system operated by the SEC.

      sec-api.io and Data2Value GmbH are independent of, and not affiliated with, sponsored by, or endorsed by the U.S. Securities and Exchange Commission.

      sec-api.io is classified under SIC code 7375 (Information Retrieval Services), providing on-demand access to structured data and online information services.