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

firecrawl-simple-client

v1.0.2

Published

A TypeScript API client library for Firecrawl

Downloads

24

Readme

Firecrawl Simple API Client

npm version Build Status License: MIT TypeScript

A TypeScript API client library for Firecrawl Simple.

What is Firecrawl Simple?

Firecrawl Simple is a stripped down and stable version of Firecrawl optimized for self-hosting and ease of contribution. Billing logic and AI features are completely removed.

Installation

npm install firecrawl-simple-client

Structure

The API client is organized for better flexibility and maintainability:

src/
├── firecrawl-client.ts - Main API client class implementation
├── config.ts           - Configuration types and defaults
├── index.ts            - Entry point exporting the API client and types
└── client/             - Auto-generated API client code

Usage

Creating a Client Instance

import { FirecrawlClient } from 'firecrawl-simple-client';

// Create a client with default configuration (localhost:3002/v1)
const client = new FirecrawlClient();

// Create a client with custom configuration
const clientWithConfig = new FirecrawlClient({
  apiUrl: 'https://api.firecrawl.com/v1',
  apiKey: 'your-api-key',
});

Basic Usage

import { FirecrawlClient } from 'firecrawl-simple-client';

const client = new FirecrawlClient({
  apiUrl: 'https://api.firecrawl.com/v1',
  apiKey: 'your-api-key',
});

// Start a crawl job
const crawlResult = await client.startCrawl({
  url: 'https://example.com',
  maxDepth: 3,
  limit: 100 // Changed from maxPages to limit
});

// Check crawl status
const crawlStatus = await client.getCrawlStatus(crawlResult.id);

// Cancel a crawl job
await client.cancelCrawl(crawlResult.id);

// Scrape a single webpage (synchronous operation)
const scrapeResult = await client.scrapeWebpage({
  url: 'https://example.com',
  waitFor: 0, // Time in ms to wait for JavaScript execution
  formats: ['markdown', 'html'],
  timeout: 30000
});

// Access scrape results directly
console.log(scrapeResult.data.markdown);

// Generate a sitemap
const sitemapResult = await client.generateSitemap({
  url: 'https://example.com'
});

// Check API health
const liveness = await client.checkLiveness();
const readiness = await client.checkReadiness();

Configuration

The client can be configured when creating an instance:

import { FirecrawlClient } from 'firecrawl-simple-client';

// Default configuration
const DEFAULT_CONFIG = {
  apiUrl: 'http://localhost:3002/v1',
};

// Create a client with custom configuration
const client = new FirecrawlClient({
  apiUrl: 'https://api.firecrawl.com/v1',
  apiKey: 'your-api-key',
});

// Get the current configuration
const config = client.getConfig();
console.log(config);

API Reference

FirecrawlClient

The main client class for interacting with the Firecrawl API.

Constructor

new FirecrawlClient(config?: Partial<FirecrawlConfig>)

Methods

  • getConfig(): Returns the current configuration
  • startCrawl(options): Start a new web crawling job
  • getCrawlStatus(jobId): Get the status of a crawl job
  • cancelCrawl(jobId): Cancel a running crawl job
  • scrapeWebpage(options): Scrape a single webpage (synchronous operation)
  • generateSitemap(options): Generate a sitemap for a website

Deprecated Methods

  • getScrapeStatus(jobId): Deprecated as scrape operations are now synchronous
  • checkLiveness(): No longer supported in the new API
  • checkReadiness(): No longer supported in the new API

Scrape Options

{
  url: string;                  // The URL to scrape (required)
  formats?: Array<string>;      // Formats to include: 'markdown', 'html', 'rawHtml', 'links', 'screenshot', 'extract', 'screenshot@fullPage'
  includeTags?: Array<string>;  // HTML tags to include in the result
  excludeTags?: Array<string>;  // HTML tags to exclude from the result
  headers?: object;             // Custom headers for the request
  waitFor?: number;             // Time in ms to wait for JavaScript execution
  timeout?: number;             // Request timeout in milliseconds
  extract?: {                   // LLM extraction configuration
    schema?: object;            // Schema for structured data extraction
    systemPrompt?: string;      // System prompt for extraction
    prompt?: string;            // User prompt for extraction
  }
}

Crawl Options

{
  url: string;                  // The URL to start crawling from (required)
  maxDepth?: number;            // Maximum depth to crawl
  limit?: number;               // Maximum number of pages to crawl (formerly maxPages)
  includePaths?: Array<string>; // URL patterns to include (formerly includeUrls)
  excludePaths?: Array<string>; // URL patterns to exclude (formerly excludeUrls)
  ignoreSitemap?: boolean;      // Whether to ignore the website's sitemap
  allowBackwardLinks?: boolean; // Allow navigation to previously linked pages
  allowExternalLinks?: boolean; // Allow following links to external websites
  scrapeOptions?: object;       // Options for scraping each page
}

Error Handling

The API may return the following error codes:

  • 402: Payment Required - You've exceeded your usage limits
  • 429: Too Many Requests - Rate limit exceeded
  • 404: Not Found - Resource not found
  • 500: Server Error - Internal server error

License

MIT