edgar
raw JSON → 0.0.0 verified Fri May 01 auth: no javascript
The 'edgar' package (v0.0.0) provides a JavaScript/TypeScript API for accessing the SEC EDGAR database, enabling retrieval of company filings, financial statements, and metadata. It is an early-stage release with no stable release yet, and the API may change frequently. Key differentiators include a promise-based interface and minimal dependencies. No release cadence established.
Common errors
error Error: Cannot find module 'edgar' ↓
cause Package not installed or typo in import.
fix
Run 'npm install edgar' and ensure import path is correct.
error TypeError: edgar.getFilings is not a function ↓
cause Wrong import style (CommonJS vs ESM) or older version.
fix
Use 'import { getFilings } from 'edgar'' instead of require.
Warnings
breaking The default export may change in future releases; use named exports for stability. ↓
fix Use import { getFilings } from 'edgar' instead of default import.
gotcha The package is in early development (v0.0.0); no breaking changes policy. ↓
fix Pin to a specific version and expect breaking changes.
deprecated No deprecation notices yet as the package is new.
Install
npm install edgar yarn add edgar pnpm add edgar Imports
- edgar wrong
const edgar = require('edgar')correctimport edgar from 'edgar' - getFilings wrong
import { getFilings } from 'edgar/getFilings'correctimport { getFilings } from 'edgar' - EdgarClient wrong
import EdgarClient from 'edgar'correctimport { EdgarClient } from 'edgar'
Quickstart
import edgar from 'edgar';
async function main() {
try {
const filings = await edgar.getFilings({
company: 'AAPL',
form: '10-K',
count: 1
});
console.log(filings);
} catch (error) {
console.error('Error:', error);
}
}
main();