I would like to write a program that takes as input a list of CIK/year/quarter entries. The program should iterate through the list and, for each entry, grab XBRL financial data from the SEC website for the given CIK/year/quarter combination.

I can decipher some parts of the SEC file structure, but not all. For example, post fixing Archives/edgar/data/1288776/11/ to the SEC base address gives a directory listing of all filings for the year 2011, for the company with CIK 1288776. Unfortunately I cannot make sense of the naming convention within this directory.

One way around this is to simply use the SEC's search tool. However, this requires that I use a web crawler and I would prefer to use ftp directly.

Can anyone clarify how accession numbers are assigned? How do others go about pulling financials from the SEC website?


3 Answers 3


Look in


You can grab the compressed version too:


This will state what file you want.

For example, I want AOL's 10-K that was filed in the first quarter of 2012. So I download


After decompressing, I see that AOL's 10-K is available at

  • $\begingroup$ Could you please elaborate a bit more on this useful info? $\endgroup$ Commented Oct 20, 2013 at 5:56

Check out this XBRL-Crawler: https://github.com/eliangcs/pystock-crawler It runs on Python but might be outdated.

You also can download the Text-Files using this Crawler: https://pypi.python.org/pypi/SECEdgar

I will test the first one, but the second one works fine.


sec-api (https://www.npmjs.com/package/sec-api) provides a websocket-based real-time API using Socket.IO - works with server-side (eg Node.js) and client-side (eg React, React Native, Angular, Vue) JavaScript.

The API returns new filings in JSON format, eg:

  companyName: 'WALT DISNEY CO/ (0001001039) (Issuer)',  
  type: '4',  
  description: 'FORM 4',  
  linkToFilingDetails:    'https://www.sec.gov/...',  
  linkToHtmlAnnouncement:    'https://www.sec.gov/...',  
  announcedAt: '2018-12-21T20:02:07-05:00'

You can hook-up to the websocket channel, and ignore all filings where type doesn't equal '10-K'.

However, the API doesn't return historical filings.

The Node.js implementation seems to be very simple:

const api = require('sec-api')(); 
api.on('filing', filing => console.log(filing));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.