A command line utility to locally index and download filings from the SEC Edgar database.
Edgar builds a local Postgres database of forms on Edgar and then allows you to download forms using queries based on any combination of CIK, company name, form type (e.g. 10-K), start date, and end date. It is also possible to download forms by the internal identifier in the database. edgar --help
provides information on all commands/sub-commands. Downloads are run in parallel enabling Edgar to download data efficiently.
-
Edgar application
a. Download and install Haskell Stack.
b. Clone this repository
c. CD to the local repository directory and type
stack install
.d. On occassion,
stack
may temporarily fail on the install due to the way it handles parallel installation of dependencies. Just runstack install
again and it will pick up where it left off. -
Install postgres and create a database
-
On the command line type
edgar init
. You will need to specify a path if you did not use the default database name (i.e. edgar). See getting help below.
The form index is housed in Postgres. edgar will keep your index up to date.
Each quarter, simply type edgar update START END
. START and END are
year-quarters, each specified as YYYYqQ. For example, 1999 quarter 2 is as
1999q2.
There are two modes to download forms. You may either specify conditions that forms needs to satisfy or list IDs from the database.
-
Conditional: Type
edgar download query --help
to see a list of conditions. You may download using any combination of CIK, company name, form type, start date, and end date. For multiple possible CIKs, company names, or form types, simply specify multiple option arguments. -
ID: Type
edgar download id ID1 ID2 ...
where IDX is the internal id identifier from the forms table in the edgar postgres database.
edgar supports simultaneous downloads (default is 4). See --help.
edgar --help
will provide help on usage. Each sub-command provides individualized help. For example,
to get help on downloading, type edgar download --help
.