Package Exports
- serpnode-js
Readme
Serpnode Node.js SDK
Minimal Node.js client for the Serpnode API. Supports authentication via apikey
header (default) or as a query parameter, and exposes the core endpoints: status
, search
, options
, and locations
.
- Requires Node.js >= 18 (uses global
fetch
).
Install
npm install serpnode-js
Usage
import { SerpnodeClient } from "serpnode-js";
const client = new SerpnodeClient({
apiKey: process.env.SERPNODE_API_KEY,
// baseUrl: "https://api.serpnode.com/v1",
// authInQuery: false,
});
const status = await client.status();
console.log(status);
const search = await client.search({ q: "site:example.com" });
console.log(search);
const opts = await client.options();
console.log(opts);
const locs = await client.locations({ q: "United States" });
console.log(locs);
Authentication
- Default:
apikey: <API_KEY>
header - Alternative: set
authInQuery: true
to sendapikey=<API_KEY>
query parameter
License
MIT