npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

reportify-sdk

v0.3.10

Published

TypeScript SDK for Reportify API - Financial data and document search

Readme

Reportify SDK for TypeScript/JavaScript

TypeScript SDK for Reportify API - Financial data and document search.

Installation

npm install reportify-sdk
# or
yarn add reportify-sdk
# or
pnpm add reportify-sdk

Quick Start

import { Reportify } from 'reportify-sdk';

// Initialize client
const client = new Reportify({ apiKey: 'your-api-key' });

// Search documents
const docs = await client.search('Tesla earnings', { num: 10 });
docs.forEach(doc => console.log(doc.title));

Features

Document Search

// General search across all categories
const docs = await client.search('revenue growth', { num: 10 });

// Search specific document types
const news = await client.searchNews('Apple iPhone', { num: 10 });
const reports = await client.searchReports('semiconductor analysis', { num: 10 });
const filings = await client.searchFilings('10-K annual report', { symbols: ['US:AAPL'] });
const transcripts = await client.searchTranscripts('guidance', { symbols: ['US:TSLA'] });

Stock Data

// Financial statements
const income = await client.stock.incomeStatement('AAPL', { period: 'quarterly' });
const balance = await client.stock.balanceSheet('AAPL');
const cashflow = await client.stock.cashflowStatement('AAPL');

// Stock quote (price data)
const quote = await client.stock.quote('AAPL', { startDate: '2024-01-01' });

// Company info (symbols without market prefix)
const overview = await client.stock.overview({ symbols: 'AAPL' });
const shareholders = await client.stock.shareholders('AAPL');

// Earnings calendar
const earnings = await client.stock.earningsCalendar({ market: 'us', startDate: '2024-01-01', endDate: '2024-01-31' });

Timeline

// Get timeline for followed entities
const companies = await client.timeline.companies({ num: 20 });
const topics = await client.timeline.topics({ num: 20 });
const institutes = await client.timeline.institutes({ num: 20 });
const publicMedia = await client.timeline.publicMedia({ num: 20 });
const socialMedia = await client.timeline.socialMedia({ num: 20 });

Knowledge Base

// Search user's uploaded documents
const chunks = await client.kb.search('quarterly revenue', { folderIds: ['folder_id'] });

Documents

// Get document content
const doc = await client.docs.get('doc_id');
const summary = await client.docs.summary('doc_id');

// List and search documents
const docs = await client.docs.list({ symbols: ['US:AAPL'], pageSize: 10 });
const chunks = await client.docs.searchChunks('revenue breakdown', { num: 5 });

// Upload documents
const result = await client.docs.uploadDocs([
  { url: 'https://example.com/report.pdf', name: 'Annual Report' }
]);

Quant (Quantitative Analysis)

// Compute technical indicators
const rsi = await client.quant.indicatorsCompute({
  symbols: ['000001'],
  formula: 'RSI(14)'
});

const macd = await client.quant.indicatorsCompute({
  symbols: ['000001'],
  formula: 'MACD()'
});

// Screen stocks by formula
const oversold = await client.quant.factorsScreen({ formula: 'RSI(14) < 30' });
const goldenCross = await client.quant.factorsScreen({ formula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 20))' });

// Get OHLCV data
const ohlcv = await client.quant.ohlcv({ symbol: '000001', startDate: '2024-01-01' });
const ohlcvBatch = await client.quant.ohlcvBatch({ symbols: ['000001', '600519'] });

// Backtest strategy
const result = await client.quant.backtest({
  startDate: '2023-01-01',
  endDate: '2024-01-01',
  symbol: '000001',
  entryFormula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 20))',
  exitFormula: 'CROSSDOWN(MA(CLOSE, 5), MA(CLOSE, 20))'
});
console.log(`Total Return: ${(result.total_return_pct * 100).toFixed(2)}%`);

Concepts

// Get latest concepts
const concepts = await client.concepts.latest();
concepts.forEach(c => console.log(c.concept_name));

// Get today's concept feeds
const feeds = await client.concepts.today();

Channels

// Search channels
const result = await client.channels.search('Goldman Sachs');

// Get followed channels
const followings = await client.channels.getFollowings();

// Follow/unfollow a channel
await client.channels.follow('channel_id');
await client.channels.unfollow('channel_id');

Chat

// Chat completion based on documents
const response = await client.chat.completion(
  'What are Tesla revenue projections?',
  {
    symbols: ['US:TSLA'],
    mode: 'comprehensive'  // concise, comprehensive, deepresearch
  }
);
console.log(response.message);

Agent

// Create agent conversation
const conv = await client.agent.createConversation(11887655289749510);

// Chat with agent
const response = await client.agent.chat(
  conv.id,
  'Analyze NVIDIA latest earnings'
);

// Get agent-generated file
const fileContent = await client.agent.getFile('file_id');
// Save in Node.js: fs.writeFileSync('output.xlsx', Buffer.from(fileContent));

User

// Get followed companies
const companies = await client.user.followedCompanies();
companies.forEach(c => console.log(`${c.symbol}: ${c.name}`));

Error Handling

import {
  Reportify,
  AuthenticationError,
  RateLimitError,
  NotFoundError,
  APIError,
} from 'reportify-sdk';

try {
  const docs = await client.search('Tesla');
} catch (error) {
  if (error instanceof AuthenticationError) {
    console.log('Invalid API key');
  } else if (error instanceof RateLimitError) {
    console.log('Rate limit exceeded, please wait');
  } else if (error instanceof NotFoundError) {
    console.log('Resource not found');
  } else if (error instanceof APIError) {
    console.log(`API error: ${error.message}`);
  }
}

Configuration

const client = new Reportify({
  apiKey: 'your-api-key',
  baseUrl: 'https://api.reportify.cn',  // Optional: custom API URL
  timeout: 30000,  // Optional: request timeout in milliseconds
});

TypeScript Support

This SDK is written in TypeScript and provides full type definitions out of the box.

import type {
  Document,
  CompanyOverview,
  FinancialStatement,
  PriceData,
  Quote,
} from 'reportify-sdk';

License

MIT License - see LICENSE for details.