JSPM

  • Created
  • Published
  • Downloads 91
  • Score
    100M100P100Q85466F
  • License MIT

The EarningsCall JavaScript library provides convenient access to the EarningsCall API. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses.

Package Exports

  • earningscall
  • earningscall/build/main/index.js
  • earningscall/build/module/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (earningscall) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

EarningsCall JavaScript Library

Version Build Status Downloads Try on RunKit Coverage Status

WARNING: THIS IS A WORK IN PROGRESS. It is not yet ready for production use.

The EarningsCall JavaScript library provides convenient access to the EarningsCall API from applications written in the JavaScript language. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses.

Requirements

  • Node.js 18+

Installation

Install the package with:

npm install earningscall
# or
yarn add earningscall

Examples

Get Transcript for a Single Year and Quarter

If you want to retrieve a specific transcript of a company for a single year and quarter, you can do so with the getTranscript method.

import { getCompany } from "earningscall";

const company = await getCompany({ symbol: "AAPL" });  // Get Company object by ticker symbol "AAPL"
const companyInfo = company.companyInfo;
console.log(`Company name: ${companyInfo.name} Sector: ${companyInfo.sector} Industry: ${companyInfo.industry}`);

const transcript = await company.getTranscript({ year: 2021, quarter: 3 });
console.log(`${companyInfo.symbol} Q3 2021 Transcript: "${transcript?.text.slice(0, 100)}..."`);

Output

Company name: Apple Inc. Sector: Technology Industry: Consumer Electronics
AAPL Q3 2021 Transcript: "Good day, and welcome to the Apple Q3 FY 2021 Earnings Conference Call. Today's call is being recorded..."

Get All Transcripts for a Company

Sometimes you want to retrieve all transcripts for a company. You can do so with the events method.

import { getCompany } from "earningscall";

const company = await getCompany({ symbol: "AAPL" });
console.log(`Getting all transcripts for: ${company.companyInfo.name}...`);
const events = await company.events();
for (const event of events) {
  const transcript = await company.getTranscript({ event });
  console.log(`${company.companyInfo.symbol} Q${event.quarter} ${event.year}`);
  console.log(` * Transcript Text: "${transcript?.text.slice(0, 100)}..."`);
}

Output

Getting all transcripts for: Apple Inc...
* Q4 2023
  Transcript Text: "Good day and welcome to the Apple Q4 Fiscal Year 2023 earnings conference call. Today's call is bein..."
* Q3 2023
  Transcript Text: "Good day and welcome to the Apple Q3 Fiscal Year 2023 earnings conference call. Today's call is bein..."
* Q2 2023
  Transcript Text: "At this time for opening remarks and introductions, I would like to turn the call over to Suhasini T..."
* Q1 2023

  ...

Get Text by Speaker

const transcriptLevel2 = await company.getTranscript({ year: 2021, quarter: 3, level: 2 });
console.log(transcriptLevel2?.speakers[0].text);

Get Prepared Remarks and Q&A for a Single Quarter

const transcriptLevel4 = await company.getTranscript({ year: 2021, quarter: 3, level: 4 });
console.log(transcriptLevel4?.prepared_remarks.slice(0, 100));
console.log(transcriptLevel4?.questions_and_answers.slice(0, 100));

Set API Key

You can set the API key with the setApiKey method.

import { setApiKey } from "earningscall";

setApiKey("your-secret-api-key");