The SEC (Securities and Exchange Commission) collects filings from companies and makes them available to the general public through a service called EDGAR.
This program demonstrates how you can use the POST https://efts.sec.gov/LATEST/search-index
to embed searching EDGAR into your own program
Visit: https://edgar-e2e.herokuapp.com/
for a demo.
- You will need
node
version 12 andnpm
version 6+ to build and run this program. PLEASE NOTE: This program only runs onnode
12.x
at this time. - Once you have the prerequisites met you can type
npm run build
from the root directory of the repository and all of the needed packages and build scripts will be run.
- After the program is built, run
npm start
from the root directory of the repository. - You can then open your browser with the URL
http://localhost:3000
to use the program.
- The architecure of this program consists of two main open source projects:
hapi.js
- A Node.js framework.Angular
- A TypeScript based SPA frontend framework.
- When
npm run build
is run, the Angular portion of the app is built, this completely resides in theclient
directory. Once built its compiled files are served by hapi.js.
- There are two APIs that make are used in this program:
GET
/api/searchTradeSymbol/{tradeSymbol}
- While EDGAR allows you to search for many things, the scope of this program only searches companies that have trade symbols, like
AAPL
for Apple Inc. This API allows you to seach by company name or trade symbols and returns the closest matches to the data as it is entered.
- While EDGAR allows you to search for many things, the scope of this program only searches companies that have trade symbols, like
GET
/api/getDocuments/{cik}?page={pageNumber}
- Once a company is chosen, all of the EDGAR documents since 2001 can be retrieved. Due to the large number of documents, only 100 results are returned at a time.
The
page
query parameter allows for pagination through the documents.
- Once a company is chosen, all of the EDGAR documents since 2001 can be retrieved. Due to the large number of documents, only 100 results are returned at a time.
The
- This is truly a "Single Page App". All Angular code is in one component and one HTML Page. If you would like to experiment with the Angular portion of the app,
you can launch hapi.js in one terminal, switch to the
/client
directory in another terminal and runng serve
. - You can then launch your browser at
http://localhost:4200
. There is a proxy configuration that redirects any request starting with/api
tolocalhost:3000
.
- Create mocks for better test covereage.
- Use better pagination than Prev Page and Next Page.
- Move to React for lighter front end.
- You tell me: This is permissive open source, so feel free to fork, make contributions, open requests, etc.