microlink-google
@microlink/google
Unified Node.js client for querying 10 Google verticals through the Microlink API. Returns normalized, structured data with pagination and lazy HTML fetching.
Quick Start
The only prerequisite to initialize @microlink/google is to have Microlink API key:
const google = require('@microlink/google')({
apiKey: process.env.MICROLINK_API_KEY
})
const page = await google('Lotus Elise S2')
console.log(page.results)
The query string supports standard Google search operators:
await google('annual report filetype:pdf')
await google('security updates site:github.com')
await google('"machine learning" site:arxiv.org')
Query Signature
const page = await google(query, options?)
Options
| Option | Type | Default | Values |
|---|---|---|---|
type |
string |
'search' |
search, news, images, videos, places, maps, shopping, scholar, patents, autocomplete |
location |
string |
'us' |
ISO 3166-1 alpha-2 country code |
period |
string |
— | hour, day, week, month, year |
limit |
number |
— | Results per page |
Google Products
Google Search (default)
const page = await google('node.js frameworks')
Page: results, knowledgeGraph?, peopleAlsoAsk?, relatedSearches?
Result: title, url, description, html()
KnowledgeGraph: title?, type?, website?, image?, description?, descriptionSource?, descriptionLink?, attributes?
Google News
const page = await google('artificial intelligence', { type: 'news' })
Result: title, url, description, date, publisher, image?, html()
Google Images
const page = await google('northern lights', { type: 'images' })
Result: title, url, image { url, width, height }, thumbnail { url, width, height }, google?, creator?, credit?, html()
Google Videos
const page = await google('cooking tutorial', { type: 'videos' })
Result: title, url, description, image?, video?, duration?, duration_pretty?, publisher?, channel?, date?, html()
Google Places
const page = await google('coffee shops denver', { type: 'places' })
Result: title, address, latitude, longitude, phone?, url?, cid, html()
Google Maps
const page = await google('apple store new york', { type: 'maps' })
Result: title, address, latitude, longitude, rating?, ratingCount?, price? { level }, type?, types?, url?, phone?, description?, opening?, thumbnail?, cid, fid?, place?, html()
Google Shopping
const page = await google('macbook pro', { type: 'shopping' })
Result: title, url, publisher, price { symbol, amount }, image?, rating? { score, total, reviews? }, id?, html()
Google Scholar
const page = await google('transformer architecture', { type: 'scholar' })
Result: title, url, description, publisher, year, citations, pdf?, id, html()
Google Patents
const page = await google('touchscreen gestures apple', { type: 'patents' })
Result: title, description, url, priority, filing, grant?, publication, inventor, assignee, language, pdf?, thumbnail?, figures?, id?, html()
Google Autocomplete
const page = await google('how to', { type: 'autocomplete' })
Result: value (no url, no html())
Pagination
Every page exposes .next() returning a promise of the next page:
const page1 = await google('query')
const page2 = await page1.next()
Iterate through all pages:
let page = await google('node.js frameworks')
while (page) {
for (const result of page.results) {
console.log(result.title)
}
page = await page.next()
}
Lazy HTML Fetching
Any result with a url exposes .html() to fetch the target page HTML on demand:
const { results } = await google('node.js frameworks')
const html = await results[0].html()
Page-level .html() fetches the Google SERP HTML itself.
More from microlinkhq/skills
optimo
Optimize and convert images and videos using format-specific compression pipelines on top of ImageMagick and FFmpeg. Use when users need to reduce image or video file sizes, batch-optimize a media directory, convert between formats (JPEG, PNG, WebP, AVIF, HEIC, JXL, MP4, WebM, MOV), resize media by percentage/dimensions/target file size, strip audio tracks from videos, or output optimized images as data URLs.
49k8s-hpa-cost-tuning
Tune Kubernetes HPA scale-up/down behavior, topology spread, and resource requests to reduce idle cluster capacity. Use when users need to audit cluster costs on a schedule, analyze post-incident scaling behavior, investigate why replicas or nodes do not scale down, or reduce over-reservation and wasted compute resources.
32nodejs-performance
Identify, validate, and ship production-safe Node.js optimizations with execution time as the primary objective. Use when users ask to reduce latency (p50/p95/p99), improve throughput, and then reduce CPU/memory/event-loop lag/FD pressure or retry amplification, using one-PR-per-improvement workflows with benchmarks.
29use-pnpm
Always use pnpm as the package manager. Use when installing, adding, or removing dependencies, running scripts, or any npm/yarn/pnpm command. Replaces npm and yarn with pnpm equivalents.
11browserless
Automate headless Chrome with a high-level Puppeteer wrapper for screenshots, PDFs, and content extraction. Use when users need to capture web page screenshots or PDFs programmatically, extract rendered HTML or text from JavaScript-heavy pages, check URL status codes, run Lighthouse audits, or build reliable headless browser automation pipelines.
3microlink-api
Extract metadata, take screenshots, generate PDFs, and scrape custom data from URLs via Microlink API and MQL. Use when users need to build link previews from URLs, capture web page screenshots or PDFs programmatically, scrape DOM elements with CSS selectors, or get structured data from any web page without managing browser infrastructure.
3