Registry / http-networking / fast-speedtest-api

fast-speedtest-api

JSON →
library0.3.2jsnpmunverified

fast-speedtest-api is a Node.js library and command-line tool designed to perform internet speed tests by leveraging the fast.com service, developed by Netflix. The library aims to provide a lightweight solution with no external dependencies, performing raw HTTP requests to mimic fast.com's underlying methodology. Its current stable version is 0.3.2, suggesting an early-stage project with infrequent updates. A key differentiator is its minimal footprint and direct interaction with fast.com's infrastructure, offering a programmatic way to measure bandwidth without relying on external packages or a full browser environment. The project is primarily community-driven, with an open invitation for contributions, indicating a potentially slower release cadence and reliance on user input for further development.

npm install fast-speedtest-api
INSTALL
IMPORT
SIG · FAST-SPEEDTEST-API
F
fast-speedtest-api
http-networkingjavascriptv0.3.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FastSpeedtest
import FastSpeedtest from 'fast-speedtest-api';
const FastSpeedtest = require('fast-speedtest-api');
While CommonJS `require` is shown in examples and widely supported, modern Node.js environments can use ESM `import` for this module which exports as default.
FastSpeedtest.UNITS
import FastSpeedtest from 'fast-speedtest-api'; const unit = FastSpeedtest.UNITS.Mbps;
import { UNITS } from 'fast-speedtest-api';
The `UNITS` enum is a static property of the default-exported `FastSpeedtest` class, not a named export itself.
CLI usage
$ npm install --global fast-speedtest-api $ fast-speedtest --help
import FastSpeedtest from 'fast-speedtest-api'; FastSpeedtest.cli()
The CLI is installed globally and run as `fast-speedtest`, not invoked programmatically from the library.

Demonstrates how to initialize the FastSpeedtest class, configure options, and retrieve the download speed using the promise-based API. Highlights the requirement for an API token and best practices for its management.

import FastSpeedtest from 'fast-speedtest-api'; // Obtain your token by visiting fast.com, opening browser devtools, // and inspecting network requests for 'https://api.fast.com/netflix/speedtest?...' to copy the token. // It's recommended to store this in an environment variable for security. const FAST_API_TOKEN = process.env.FAST_API_TOKEN || 'YOUR_APP_TOKEN_HERE'; const speedtest = new FastSpeedtest({ token: FAST_API_TOKEN, // Required: Replace with your actual fast.com API token verbose: false, // Optional: Default is false timeout: 10000, // Optional: Default is 5000ms. Consider increasing for unstable networks. https: true, // Optional: Default is true urlCount: 5, // Optional: Default is 5 download URLs bufferSize: 8, // Optional: Default is 8MB buffer size unit: FastSpeedtest.UNITS.Mbps // Optional: Default is Bps (Bytes per second) }); speedtest.getSpeed().then(speed => { console.log(`Measured Speed: ${speed} ${speedtest.unit}`); console.log('Test completed successfully.'); }).catch(error => { console.error(`Speed test failed: ${error.message}`); console.error('Please ensure your network connection is stable and the token is valid.'); });
fast-speedtest-api --version
Debug
Known issues
gotchaThe `token` parameter is mandatory for API usage and must be manually retrieved from `fast.com`'s network requests in browser developer tools. There is no automated or programmatic way to obtain it directly through the library.
fix
Go to fast.com, open browser DevTools (Network tab), find a request to `api.fast.com/netflix/speedtest`, and copy the token from the URL query parameters.
affects: >=0.1.0
gotchaThe package version (0.3.2) indicates an early-stage project. While functional, it may have a slower development pace, limited long-term support, or potential for unannounced breaking changes in future minor versions.
fix
Review the GitHub repository for recent activity and issues before relying on it for critical applications. Consider pinning to a specific version for stability.
affects: >=0.1.0
gotchaThe library directly interfaces with the internal `fast.com` API, which is not officially public. This means Netflix could change their API endpoints or authentication mechanisms at any time without notice, potentially breaking this library.
fix
Monitor the library's GitHub issues for reports of API changes or breakages. Be prepared for the possibility of the library becoming non-functional if the underlying fast.com API changes significantly.
affects: >=0.1.0
gotchaThe default timeout for the speed test is 5000 milliseconds (5 seconds). On slower or less stable network connections, this timeout might be too aggressive, leading to premature test failures.
fix
Increase the `timeout` option in the `FastSpeedtest` constructor (e.g., `timeout: 15000` for 15 seconds) to accommodate slower network conditions.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Token is required
The 'token' property was not provided in the FastSpeedtest constructor options, or it was an empty string.
fix
Provide a valid token retrieved from fast.com's network tab: `new FastSpeedtest({ token: 'YOUR_APP_TOKEN' })`.
Error: Request timed out
The network requests made by the speed test exceeded the configured `timeout` duration, likely due to a slow or unstable internet connection.
fix
Increase the `timeout` option in the `FastSpeedtest` constructor, for example: `timeout: 15000` for 15 seconds.
Error: getaddrinfo ENOTFOUND api.fast.com
The DNS lookup for `api.fast.com` failed, indicating a lack of internet connectivity, incorrect DNS settings, or a temporary issue with the fast.com domain.
fix
Verify your internet connection and DNS settings. Try pinging `api.fast.com` from your terminal to confirm connectivity.
Upgrade
Version history
0.3.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources
fast-speedtest-api — npm install fast-speedtest-api · libregistry