Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joeychilson/edgar
A Go library for accessing the SEC's EDGAR database.
https://github.com/joeychilson/edgar
edgar go sec
Last synced: 1 day ago
JSON representation
A Go library for accessing the SEC's EDGAR database.
- Host: GitHub
- URL: https://github.com/joeychilson/edgar
- Owner: joeychilson
- License: mit
- Created: 2024-11-15T06:41:36.000Z (2 days ago)
- Default Branch: main
- Last Pushed: 2024-11-15T07:05:34.000Z (2 days ago)
- Last Synced: 2024-11-15T07:30:51.465Z (2 days ago)
- Topics: edgar, go, sec
- Language: Go
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# edgar
A Go library for accessing the SEC's EDGAR database.
## Installation
```bash
go get github.com/joeychilson/edgar
```## Example
```go
package mainimport (
"context"
"log""github.com/joeychilson/edgar"
)func main() {
ctx := context.Background()// You should set a custom user agent or you will be rate limited.
client := edgar.NewClient(edgar.WithUserAgent("CompanyName "))tickers, err := client.SearchCompanies(ctx, &edgar.CompanyFilterOptions{
Tickers: []string{"AAPL"},
})
if err != nil {
log.Fatal(err)
}filings, err := client.Filings(ctx, tickers[0].CIK, &edgar.FilingFilterOptions{
Forms: []string{"10-K"},
})
if err != nil {
log.Fatal(err)
}files, err := client.FilingDirectory(ctx, tickers[0].CIK, filings[0].AccessionNumber, &edgar.FilingDirectoryFilterOptions{
DocumentName: filings[0].PrimaryDocument,
})
if err != nil {
log.Fatal(err)
}contents, err := client.FileContents(ctx, files[0].URL)
if err != nil {
log.Fatal(err)
}log.Println(string(contents))
}
```