npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@serphouse/serphouse-nodejs

v1.0.0

Published

Automate your search engines (Google, Bing, Yahoo) result (serp api) using Serphouse.com API client and retrive in structured JSON format.

Downloads

22

Readme

@serphouse/serphouse-nodejs

GitHub Actions Workflow Status GitHub Actions Workflow Status NPM Version

SERPHouse API is the starting point on your journey towards building a powerful SEO software. With SERPHouse you can get all the data you’d need to build an efficient application while also saving your time and your budget.

This comprehensive document designed to provide you with all the technical information as well as product information you need to interact with our API and harness its full potential. Whether you're a software developer integrating SERPHouse SERP API services into your application or a curious user exploring the possibilities, this API documentation will serve as your go-to resource.

High Volume SERP API for SEO professionals and data scientist. We built reliable, accurate and cost efficient solution, We take cares of resolving captcha, managing proxy to ensure you get reliable Structured JSON data.

This API supported Serphouse's standard REST API that accepts/returns JSON requests. Here is the API reference

It does supports EcmaScript 5, EcmaScript 6, EcmaScript 8, TypeScript, async-await, Promises, Callback!!!
It supports pure JSON response.
All methods support Promise and Callback both.

Get started

Using the Serphouse API wrapper for Node.js is really simple. Follow these steps to integrate it into your project:

Documentation

Documentation of Serphouse's API and their usage is available at https://docs.serphouse.com/

Prerequisites

node >= 14.21.3

Installation

npm install @serphouse/serphouse-nodejs --save

Configuration Using JavaScript


var serphouse = require("@serphouse/serphouse-nodejs")("YOUR_API_KEY");

OR

var SerphouseAPI = require("@serphouse/serphouse-nodejs");
var serphouse = new SerphouseAPI("YOUR_API_KEY");

OR

var SerphouseAPI = require("@serphouse/serphouse-nodejs");
var serphouse = new SerphouseAPI();
serphouse.setApiToken("YOUR_API_KEY");

Configuration Using TypeScript

import * as SerphouseAPI from "@serphouse/serphouse-nodejs";
var serphouse = new SerphouseAPI();
serphouse.setApiToken("YOUR_API_KEY");

Get API Key

You can obtain an API key by registering at https://app.serphouse.com/register. This key will be required for accessing the API.

Examples

  1. Serp Api

  2. Domains List

  3. Language List

  4. Locations List

  5. Account Info

  6. Trends Api


Serp Api

  1. SERP Live
/** Performing a realtime search  */
var payload = {
  data: {
    q: "Coffee",
    domain: "google.com",
    lang: "en",
    device: "desktop",
    serp_type: "web",
    loc: "Alba,Texas,United States",
    verbatim: 0,
    postback_url: "https://webhook.site/8f885f1f-c38a-4a10-8506-335441213208",
    page: 1,
    num_result: 10,
  },
  path: { responseType: "json" },
};

try {
  var response = await serphouse.SerpApi.live(payload);
} catch (error) {
  return;
}

If you need to get response by responseType HTML or Json then you can use Like Below Example:

serphouse.SerpApi.live("DATA_ARRAY", "responseType"); // default responseType is Json
  1. SERP Schedule
/** Create a new schedule */
var payload = {
  data: [
    {
      q: "Coffee",
      domain: "google.com",
      lang: "en",
      device: "desktop",
      serp_type: "web",
      loc: "Alba,Texas,United States",
      verbatim: 0,
      postback_url: "https://webhook.site/8f885f1f-c38a-4a10-8506-335441213208",
      page: 1,
      num_result: 10,
    },
  ],
};

try {
  var response = await serphouse.SerpApi.schedule(payload);
} catch (error) {
  return;
}
  1. SERP Check
/** You will get a status of your serp task */
var payload = { query: { id: 127105618 } };
try {
  var response = await serphouse.SerpApi.check(payload);
} catch (error) {
  return;
}
  1. SERP Get
/** you will receive an json array containing a result of your serp query */
var payload = {
  query: { id: 127673427 },
  path: { responseType: "html" }, // path is optional default get json
};
try {
  var response = await serphouse.SerpApi.get(payload);
} catch (error) {
  return;
}

If you need to get response by responseType HTML or Json then you can use like below example:

serphouse.SerpApi.get("SERP_ID", "responseType"); // default responseType is Json

Domains List

  1. Get Domains List
/** Get domains list  */
try {
  var response = await serphouse.Domains.list();
} catch (error) {
  return;
}

Language List

  1. Get Languages List
/** Get list of languages by Google, Bing and Yahoo  */
try {
  const payload = { path: { type: "google" } };
  var response = await serphouse.Languages.list(payload);
} catch (error) {
  return;
}

If you need to get Languages List by google, bing and yahoo then you can use like below example:

serphouse.Languages.list({ type: "bing" }); // default type is google

Locations List

  1. Get Locations List
/** Get locations available for our SERP API  */
try {
  const payload = {
    query: {
      q: "india",
      type: "google",
    },
  };
  var response = await serphouse.Location.search(payload);
} catch (error) {
  return;
}

Account Info

  1. Get Account Information
/** Get your account information */
try {
  var response = await serphouse.Account.fetch();
} catch (error) {
  return;
}

Trends Api

  1. Trend Search
/** Performing a realtime google trends search  */
try {
  var payload = {
    time_zone_offset: -330,
    keywords: "google,youtube",
    time: "now 1-d",
  };
  var response = await serphouse.Trends.search(payload);
} catch (error) {
  return;
}
  1. Trend Schedule
/** Create trend schedule  */
try {
  var payload = {
    data: [
      {
        time_zone_offset: -330,
        keywords: "google,youtube",
        time: "now 1-d",
      },
    ],
  };
  var response = await serphouse.Trends.schedule(payload);
} catch (error) {
  return;
}
  1. Get TimeZone List
/** Retrieve full list of timezone and its offset value  */
try {
  var response = await serphouse.Trends.timeZoneList();
} catch (error) {
  return;
}
  1. Get Categories List
/** Retrieve full list of categories and sub category  */
try {
  var response = await serphouse.Trends.categoryList();
} catch (error) {
  return;
}
  1. Get Country and State List
/** Retrieve full list of country and state */
try {
  var response = await serphouse.Trends.countryStateList();
} catch (error) {
  return;
}
  1. Get Language List
/** Retrieve full list of language. */
try {
  var response = await serphouse.Trends.languageList();
} catch (error) {
  return;
}
  1. Trends Check
/** Check search status. */
try {
  var payload = { query: { id: 127105618 } };
  var response = await serphouse.Trends.check(payload);
} catch (error) {
  return;
}
  1. Trends Get
/** Get result of your trend search query. */
try {
  var payload = { query: { id: 127105618 } };
  var response = await serphouse.Trends.get(payload);
} catch (error) {
  return;
}

Response

Example of success response.

{Response : {"status":"success","msg":"Completed","search_metadata":{"id":128078258,"status":"success","created_at":"2024-05-04T06:20:10.000000Z","processed_at":"2024-05-04 06:20:10"},"search_parameters":{"langauge_code":"en-US","geo":"US","keywords":"google,youtube","time_zone_offset":"-330","time":"now 1-d","category":0,"property":"youtube"},"results":{"TIMESERIES":[{"time":"1714716960","formattedTime":"May 3, 2024 at 11:46 AM","formattedAxisTime":"May 3 at 11:46 AM","value":[19,72],"hasData":[true,true],"formattedValue":["19","72"]}],"GEO_MAP":{"google":{"default":{"geoMapData":[{"geoCode":"US-VT","geoName":"Vermont","value":[100],"formattedValue":["100"],"maxValueIndex":0,"hasData":[true]}]}},"youtube":{"default":{"geoMapData":[{"geoCode":"US-NH","geoName":"New Hampshire","value":[100],"formattedValue":["100"],"maxValueIndex":0,"hasData":[true]}]}}},"RELATED_QUERIES":{"google":{"default":{"rankedList":[{"rankedKeyword":[{"query":"google link","value":100,"formattedValue":"100","hasData":true,"link":"/trends/explore?q=google+link&date=now+1-d&geo=US"}]},{"rankedKeyword":[{"query":"the man who killed google search","value":1650,"formattedValue":"+1,650%","link":"/trends/explore?q=the+man+who+killed+google+search&date=now+1-d&geo=US"}]}]}},"youtube":{"default":{"rankedList":[{"rankedKeyword":[{"query":"on youtube","value":100,"formattedValue":"100","hasData":true,"link":"/trends/explore?q=on+youtube&date=now+1-d&geo=US"}]},{"rankedKeyword":[{"query":"jayson tatum youtube channel","value":5300,"formattedValue":"Breakout","link":"/trends/explore?q=jayson+tatum+youtube+channel&date=now+1-d&geo=US"}]}]}}}}}}

Example of validation errors response.

  {"status":"error","msg":"validation_error","error":{"time_zone_offset":["The time zone offset field is required."]}}