Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TalorData for JavaScript/TypeScript

TalorDataofficial JavaScript SDK for integrating search data into your AI workflow, RAG / fine-tuning, or JavaScript application. TalorData helps developers and AI applications connect to real-time, structured, and reliable search data through a single SERP API. With support for Google, Bing, News, Images, Shopping, Maps, Scholar, Trends, and more, TalorData makes it easier to build AI agents, search copilots, SEO workflows, and data-driven automations powered by live search results.

Install

npm install talordata-serp

Quick Start

Sign up at TalorData and get your API key from the dashboard.

const { Client } = require("talordata-serp");

async function main() {
  const client = new Client({ apiToken: process.env.TALORDATA_API_TOKEN });

  const result = await client.search({
    engine: "google",
    q: "car",
  });

  console.log(result.search_metadata?.status);
  console.log(result.search_information?.query_displayed);
}

main().catch(console.error);

Examples

  • examples/basic-search.js: basic json=1 search example.

  • examples/json-plus-html.jsjson=2 example with both HTML and parsed JSON.

  • examples/html-output.jsjson=3 example that prints HTML output.

You can also set the token once in your shell:

export TALORDATA_API_TOKEN=your_token

Then use the top-level helper:

const talordata = require("talordata-serp");

async function main() {
  const result = await talordata.search({
    engine: "google",
    q: "car",
  });

  console.log(result);
}

main().catch(console.error);

API Design

  • new Client({ apiToken }): create a reusable client.

  • client.search(...): send a form-encoded POST request to /serp/v1/request and return the parsed result.

  • client.searchJson(...): alias of search(...).

  • client.searchHtml(...): return the HTML string for json=3.

  • client.rawSearch(...): return the raw HTTP response body.

JSON Modes

  • json=1: returns parsed JSON data. This is the default mode used by client.search(...).

  • json=2: returns both html and json. The SDK automatically parses data.json into an object when possible.

  • json=3: returns HTML. The SDK unwraps the HTML string from the API response.

Example With URL

const { Client } = require("talordata-serp");

async function main() {
  const client = new Client({ apiToken: process.env.TALORDATA_API_TOKEN });

  const result = await client.search({
    url: "https://www.google.com/search",
    q: "car",
    json: 1,
  });

  console.log(result);
}

main().catch(console.error);

Notes

  • Auth uses the Authorization: Bearer <token> header.

  • Requests are sent as application/x-www-form-urlencoded.

  • Boolean params are normalized to "1" and "0" before sending.

Learn more

Explore TalorData SERP API integrations and use cases:

Quick Start

View Documentation

Releases

Packages

Contributors

Languages