{"id":13174,"library":"fast-speedtest-api","title":"Fast.com Speed Test API","description":"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.","status":"maintenance","version":"0.3.2","language":"javascript","source_language":"en","source_url":"https://github.com/branchard/fast-speedtest-api","tags":["javascript","speedtest","speed","network","test","fast","bandwidth","kbps","mbps"],"install":[{"cmd":"npm install fast-speedtest-api","lang":"bash","label":"npm"},{"cmd":"yarn add fast-speedtest-api","lang":"bash","label":"yarn"},{"cmd":"pnpm add fast-speedtest-api","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"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.","wrong":"const FastSpeedtest = require('fast-speedtest-api');","symbol":"FastSpeedtest","correct":"import FastSpeedtest from 'fast-speedtest-api';"},{"note":"The `UNITS` enum is a static property of the default-exported `FastSpeedtest` class, not a named export itself.","wrong":"import { UNITS } from 'fast-speedtest-api';","symbol":"FastSpeedtest.UNITS","correct":"import FastSpeedtest from 'fast-speedtest-api';\nconst unit = FastSpeedtest.UNITS.Mbps;"},{"note":"The CLI is installed globally and run as `fast-speedtest`, not invoked programmatically from the library.","wrong":"import FastSpeedtest from 'fast-speedtest-api';\nFastSpeedtest.cli()","symbol":"CLI usage","correct":"$ npm install --global fast-speedtest-api\n$ fast-speedtest --help"}],"quickstart":{"code":"import FastSpeedtest from 'fast-speedtest-api';\n\n// Obtain your token by visiting fast.com, opening browser devtools,\n// and inspecting network requests for 'https://api.fast.com/netflix/speedtest?...' to copy the token.\n// It's recommended to store this in an environment variable for security.\nconst FAST_API_TOKEN = process.env.FAST_API_TOKEN || 'YOUR_APP_TOKEN_HERE';\n\nconst speedtest = new FastSpeedtest({\n    token: FAST_API_TOKEN, // Required: Replace with your actual fast.com API token\n    verbose: false,        // Optional: Default is false\n    timeout: 10000,        // Optional: Default is 5000ms. Consider increasing for unstable networks.\n    https: true,           // Optional: Default is true\n    urlCount: 5,           // Optional: Default is 5 download URLs\n    bufferSize: 8,         // Optional: Default is 8MB buffer size\n    unit: FastSpeedtest.UNITS.Mbps // Optional: Default is Bps (Bytes per second)\n});\n\nspeedtest.getSpeed().then(speed => {\n    console.log(`Measured Speed: ${speed} ${speedtest.unit}`);\n    console.log('Test completed successfully.');\n}).catch(error => {\n    console.error(`Speed test failed: ${error.message}`);\n    console.error('Please ensure your network connection is stable and the token is valid.');\n});","lang":"typescript","description":"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."},"warnings":[{"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.","message":"The `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.","severity":"gotcha","affected_versions":">=0.1.0"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":">=0.1.0"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Increase the `timeout` option in the `FastSpeedtest` constructor (e.g., `timeout: 15000` for 15 seconds) to accommodate slower network conditions.","message":"The 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.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Provide a valid token retrieved from fast.com's network tab: `new FastSpeedtest({ token: 'YOUR_APP_TOKEN' })`.","cause":"The 'token' property was not provided in the FastSpeedtest constructor options, or it was an empty string.","error":"Error: Token is required"},{"fix":"Increase the `timeout` option in the `FastSpeedtest` constructor, for example: `timeout: 15000` for 15 seconds.","cause":"The network requests made by the speed test exceeded the configured `timeout` duration, likely due to a slow or unstable internet connection.","error":"Error: Request timed out"},{"fix":"Verify your internet connection and DNS settings. Try pinging `api.fast.com` from your terminal to confirm connectivity.","cause":"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.","error":"Error: getaddrinfo ENOTFOUND api.fast.com"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"fast-speedtest-api"}