Skip to main content
The Search endpoint queries the web and returns ad-free results. It supports web, news, and image search with AI-grounded answers that synthesize results into a single cited response. Endpoint: POST https://api.geekflare.com/search
Install the official SDK: npm install @geekflare/api-node or pip install geekflare-api

Search the web and get structured JSON results. Costs 2 credits.
import { GeekflareClient } from '@geekflare/api-node';

const client = new GeekflareClient({ apiKey: 'YOUR_API_KEY' });
const result = await client.search({ query: 'Nvidia stock performance' });
console.log(result);

from geekflare_api.client import GeekflareClient
from geekflare_api.models import SearchRequestDto

with GeekflareClient(api_key='YOUR_API_KEY') as client:
    result = client.search(SearchRequestDto(query='best running shoes'))
    print(result)
curl -X POST https://api.geekflare.com/search \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "best running shoes"}'
{
  "timestamp": 1778737930991,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "query": "best running shoes",
    "count": 10,
    "source": ["web"],
    "location": "us",
    "time": "any",
    "scrape": false,
    "scrapeLimit": 3,
    "test": { "id": "abc123" }
  },
  "data": [
    {
      "title": "Best Running Shoes of 2026 — Tested & Reviewed",
      "url": "https://example.com/best-running-shoes",
      "snippet": "We tested over 100 pairs to find the best running shoes for every type of runner...",
      "date": "Jan 15, 2025",
      "position": 1
    },
    {
      "title": "Top 10 Running Shoes for 2026",
      "url": "https://example2.com/running-shoes",
      "snippet": "From track to trail, here are the top running shoes this year...",
      "position": 2
    }
  ]
}

Search recent news articles on any topic.
const result = await client.search({
  query: 'AI news',
  source: 'news',
  limit: 5
});
result = client.search(SearchRequestDto(query='AI news', source='news', limit=5))
curl -X POST https://api.geekflare.com/search \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "AI news", "source": "news", "limit": 5}'
{
  "timestamp": 1778737930991,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "query": "AI news",
    "count": 5,
    "source": ["news"],
    "time": "any",
    "test": { "id": "abc123" }
  },
  "data": [
    {
      "title": "OpenAI releases new model with improved reasoning",
      "url": "https://techcrunch.com/2025/01/openai-new-model",
      "snippet": "OpenAI today announced a new model that significantly improves on reasoning tasks...",
      "date": "2 hours ago",
      "position": 1
    }
  ]
}

Search for images on any topic.
const result = await client.search({
  query: 'golden gate bridge',
  source: 'images',
  limit: 5
});
result = client.search(SearchRequestDto(query='golden gate bridge', source='images', limit=5))
curl -X POST https://api.geekflare.com/search \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "golden gate bridge", "source": "images", "limit": 5}'
{
  "timestamp": 1778737930991,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "query": "golden gate bridge",
    "count": 5,
    "source": ["images"],
    "test": { "id": "abc123" }
  },
  "data": [
    {
      "title": "Golden Gate Bridge at Sunset",
      "imageUrl": "https://example.com/images/golden-gate.jpg",
      "sourceUrl": "https://example.com/golden-gate-bridge",
      "width": 1920,
      "height": 1080
    }
  ]
}

Grounded Answer

Get an AI-synthesized answer with inline citations from search results. Ideal for RAG pipelines and AI agents. Costs 5 credits.
const result = await client.search({
  query: 'what is the Model Context Protocol',
  groundedAnswer: true
});
result = client.search(SearchRequestDto(
    query='what is the Model Context Protocol',
    grounded_answer=True
))
curl -X POST https://api.geekflare.com/search \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "what is the Model Context Protocol", "groundedAnswer": true}'
{
  "timestamp": 1778737930991,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "query": "what is the Model Context Protocol",
    "count": 10,
    "source": ["web"],
    "test": { "id": "abc123" }
  },
  "data": {
    "answer": "The Model Context Protocol (MCP) is an open standard developed by Anthropic that allows AI assistants to connect with external data sources and tools [1]. It provides a universal interface for LLMs to interact with APIs, databases, and local services [2].",
    "sources": [
      { "title": "MCP Documentation", "url": "https://modelcontextprotocol.io", "position": 1 },
      { "title": "Anthropic Blog", "url": "https://www.anthropic.com/news/model-context-protocol", "position": 2 }
    ]
  }
}

Search with Content Scraping

Scrape the top result pages and return their full content alongside search results. Costs 4 credits.
const result = await client.search({
  query: 'NestJS authentication guide',
  scrape: true,
  scrapeLimit: 3
});
result = client.search(SearchRequestDto(
    query='NestJS authentication guide',
    scrape=True,
    scrape_limit=3
))
curl -X POST https://api.geekflare.com/search \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "NestJS authentication guide", "scrape": true, "scrapeLimit": 3}'
{
  "timestamp": 1778737930991,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "query": "NestJS authentication guide",
    "count": 10,
    "scrape": true,
    "scrapeLimit": 3,
    "test": { "id": "abc123" }
  },
  "data": [
    {
      "title": "NestJS Authentication with JWT",
      "url": "https://docs.nestjs.com/security/authentication",
      "snippet": "Authentication is an essential part of most applications...",
      "position": 1,
      "content": "# Authentication\n\nAuthentication is an essential part of most applications..."
    }
  ]
}

Markdown Output

Return results as clean Markdown instead of JSON. Ideal for feeding directly into LLMs.
const result = await client.search({
  query: 'TypeScript tips 2025',
  format: 'markdown'
});
result = client.search(SearchRequestDto(query='TypeScript tips 2025', format='markdown'))
curl -X POST https://api.geekflare.com/search \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "TypeScript tips 2025", "format": "markdown"}'
{
  "timestamp": 1778737930991,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "query": "TypeScript tips 2025",
    "count": 10,
    "test": { "id": "abc123" }
  },
  "data": "1. [TypeScript 5.4 New Features](https://example.com)\n   - Use `satisfies` for safer type assertions...\n\n2. [TypeScript Tips for Large Codebases](https://example2.com)\n   - Prefer interface over type for objects..."
}

Time Filtering

Limit results to a specific time range.
ValueDescription
anyNo time filter (default)
hPast hour
dPast day
wPast week
mPast month
yPast year
h2, d7Past 2 hours, past 7 days, etc.
const result = await client.search({
  query: 'AI news',
  source: 'news',
  time: 'd'
});
result = client.search(SearchRequestDto(query='AI news', source='news', time='d'))
curl -X POST https://api.geekflare.com/search \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "AI news", "source": "news", "time": "d"}'

Domain Filtering

Include or exclude specific domains from results.
const result = await client.search({
  query: 'React hooks tutorial',
  includeDomains: ['reddit.com', 'stackoverflow.com'],
  excludeDomains: ['pinterest.com']
});
result = client.search(SearchRequestDto(
    query='React hooks tutorial',
    include_domains=['reddit.com', 'stackoverflow.com'],
    exclude_domains=['pinterest.com']
))
curl -X POST https://api.geekflare.com/search \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "React hooks tutorial",
    "includeDomains": ["reddit.com", "stackoverflow.com"],
    "excludeDomains": ["pinterest.com"]
  }'

Search within a specific category for more relevant results.
CategoryDescription
generalGeneral web search (default)
codeCode snippets and technical content
pdfPDF documents
researchAcademic and research papers
linkedinLinkedIn profiles and posts
wikiWikipedia content
const result = await client.search({
  query: 'binary search tree implementation',
  category: 'code'
});
result = client.search(SearchRequestDto(
    query='binary search tree implementation',
    category='code'
))
curl -X POST https://api.geekflare.com/search \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "binary search tree implementation", "category": "code"}'

All Parameters

ParameterTypeDefaultDescription
querystringrequiredSearch query (max 2048 chars)
limitnumber10Number of results (1–100)
sourceweb | news | imageswebSearch source
formatjson | markdown | htmljsonOutput format
timestringanyTime filter (h, d, w, m, y, h2, d7, etc.)
locationstringusCountry code (ISO alpha-2)
categorystringgeneralCategory (general, code, pdf, research, linkedin, wiki)
includeDomainsarrayOnly return results from these domains
excludeDomainsarrayExclude results from these domains
groundedAnswerbooleanfalseReturn AI-synthesized answer with citations
scrapebooleanfalseScrape content from top result URLs
scrapeLimitnumber3Number of URLs to scrape (1–10, requires scrape: true)

Credits

ModeCredits
Standard search2
Search with scraping (scrape: true)4
Grounded answer (groundedAnswer: true)5

Node.js SDK

npm install @geekflare/api-node

Python SDK

pip install geekflare-api