Skip to main content

Installation

Choose your preferred installation method to get started with node-csfd-api.

Node.js requirements

node-csfd-api requires Node.js 18 or higher. Make sure your Node version meets this requirement before installing.
You can check your Node version by running:
node --version

Package manager installation

Install the library as a dependency in your Node.js project:
1

Install the package

Use your preferred package manager to install node-csfd-api:
npm install node-csfd-api
2

Verify installation

Create a simple test file to verify the installation:
test.ts
import { csfd } from 'node-csfd-api';

csfd.movie(535121).then((movie) => {
  console.log(movie.title); // Should print: "Na špatné straně"
});
Run the test file:
node test.ts

CLI installation via Homebrew

For macOS and Linux users, you can install the CLI globally using Homebrew:
1

Add the tap

First, add the bartholomej/tap repository:
brew tap bartholomej/tap
2

Install the CLI

Install the csfd command-line tool:
brew install csfd
3

Verify CLI installation

Test the CLI by exporting some ratings:
csfd export ratings 912
This should export ratings for user 912 to a CSV file.
The Homebrew installation provides the csfd command globally. If you only need the library in your project, use the npm/yarn/pnpm installation instead.

Docker installation

Run the CSFD API as a standalone REST service using Docker:
1

Pull the image

Pull the latest pre-built Docker image:
docker pull bartholomej/node-csfd-api
2

Run the container

Start the container and expose it on port 3000:
docker run -p 3000:3000 bartholomej/node-csfd-api
3

Test the API

Test the REST API by making a request:
curl http://localhost:3000/movie/535121
You should receive JSON data for the movie.

Building your own image

If you want to customize the Docker image:
# Clone the repository
git clone https://github.com/bartholomej/node-csfd-api.git
cd node-csfd-api

# Build the image
docker build -t node-csfd-api .

# Run your custom image
docker run -p 3000:3000 node-csfd-api

NPX usage (no installation)

You can run the CLI tools without installing anything using npx:
# Export ratings to CSV
npx node-csfd-api export ratings 912

# Export to JSON
npx node-csfd-api export ratings 912 --json

# Export to Letterboxd format
npx node-csfd-api export ratings 912 --letterboxd

# Start REST API server
npx node-csfd-api server

# Start MCP server
npx node-csfd-api mcp
Using npx downloads and runs the package on-demand without permanent installation. This is great for one-time operations.

Module system support

The library supports both ESM (ES Modules) and CommonJS:
import { csfd } from 'node-csfd-api';

const movie = await csfd.movie(535121);
console.log(movie.title);

TypeScript support

The library is written in TypeScript and includes full type definitions out of the box. No need to install separate @types packages.
import { csfd, CSFDMovie } from 'node-csfd-api';

const movie: CSFDMovie = await csfd.movie(535121);
// Full autocomplete and type checking available

Next steps

Now that you have the library installed, continue to the quickstart guide to make your first API call:

Quickstart Guide

Learn how to fetch movie data, search content, and access creator information

Build docs developers (and LLMs) love