everapi:serpnode

v0.1.1Published 2 days ago

Serpnode for Meteor

A Meteor package to query the serpnode.com API and retrieve structured Google SERP data.

Install

meteor add everapi:serpnode

Quickstart: search Google with Meteor

1import { Serpnode } from 'meteor/everapi:serpnode';
2
3const client = Serpnode.createClient(process.env.SERPNODE_API_KEY);
4
5const results = await client.search({
6  q: 'site:screenshotbase.com screenshots',
7  engine: 'google',
8  num: 10
9});
10
11console.log(results);

Other endpoints

1// API status and quota
2const status = await client.status();
3
4// Available options (gl, hl, etc.)
5const opts = await client.options();
6
7// Location lookup
8const locs = await client.locations('United States');

Use cases

1) SEO rank tracking (daily)

1const queries = ['best screenshot api', 'screenshot service', 'website screenshot tool'];
2for (const q of queries) {
3  const { organic_results } = await client.search({ q, engine: 'google', num: 50, gl: 'us', hl: 'en' });
4  // store organic_results in your DB for historical rank tracking
5}

2) Local SEO with locations

1const { locations } = await client.locations('San Francisco, California, United States');
2const loc = locations?.[0];
3const local = await client.search({ q: 'coffee', engine: 'google', location_id: loc?.id, num: 20 });

3) Image and News verticals

1const images = await client.search({ q: 'aurora borealis', engine: 'google_images', num: 30 });
2const news = await client.search({ q: 'web performance', engine: 'google_news', num: 20 });

4) Shopping & product research

1const shopping = await client.search({ q: 'wireless mouse', engine: 'google_shopping', num: 40 });

5) Pagination / deep results

1const page1 = await client.search({ q: 'meteor tutorial', engine: 'google', start: 0, num: 10 });
2const page2 = await client.search({ q: 'meteor tutorial', engine: 'google', start: 10, num: 10 });

Set SERPNODE_API_KEY as an environment variable or via Meteor settings.

Publishing to Atmosphere

meteor login
cd clients/js/serpnode-meteor
meteor publish --create

License

MIT