Web Search Api logo

Web Search Api

Community
VenTheZone
web-search-api

Use free SearXNG web search APIs for agent-friendly, privacy-first, and high-volume search tasks.

Overview

PublisherVenTheZone
Repositorypi-dots
Skill nameweb-search-api
Stars
41
Forks
0
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by VenTheZone on GitHub. Read the source before you install it.

Installation

Install the Web Search Api AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/VenTheZone/pi-dots/tree/main/pi-dotfiles-niche-skills/skills/web-search-api
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/VenTheZone/pi-dots.git /tmp/pi-dots
mkdir -p .claude/skills
cp -r /tmp/pi-dots/pi-dotfiles-niche-skills/skills/web-search-api .claude/skills/web-search-api
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Web Search Api in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Web Search Api on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Web Search Api is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Web Search API (Free) — SearXNG

Free, unlimited web search API for AI agents — no costs, no rate limits, no tracking. Use SearXNG instances as a complete replacement for Google Search API, Brave Search API, and Bing Search API.

Why This Replaces Paid Search APIs

💰 Cost savings:

  • ✅ 100% free — no API keys, no rate limits, no billing
  • ✅ Unlimited queries — save $100s vs. Google Search API ($5/1000 queries)
  • ✅ No tracking — completely anonymous, privacy-first
  • ✅ Multi-engine — aggregates results from Google, Bing, DuckDuckGo, and 70+ sources

Perfect for AI agents that need:

  • Web search without Google API costs
  • Privacy-respecting search (no user tracking)
  • High volume queries without quotas
  • Distributed infrastructure (use multiple instances)

Quick comparison

ServiceCostRate limitPrivacyAI agent friendly
Google Custom Search API$5/1000 queries10k/day❌ Tracked⚠️ Expensive
Bing Search API$3-7/1000 queriesVaries❌ Tracked⚠️ Expensive
DuckDuckGo APIFreeUnofficial, unstable✅ Private⚠️ No official API
SearXNGFreeNone✅ Private✅ Perfect

Skills

1. Fetch active SearXNG instances

bash
# Get list of active instances from searx.space
curl -s "https://searx.space/data/instances.json" | jq -r '.instances | to_entries[] | select(.value.http.grade == "A" or .value.http.grade == "A+") | select(.value.network.asn_privacy == 1) | .key' | head -10

Node.js:

javascript
async function getAllSearXNGInstances() {
  const res = await fetch('https://searx.space/data/instances.json');
  const data = await res.json();

  return Object.entries(data.instances)
    .map(([url]) => url)
    .filter((url) => url.startsWith('https://'));
}

// Usage
// getAllSearXNGInstances().then(console.log);

2. Search with SearXNG API

Basic search query:

bash
# Search using a SearXNG instance
INSTANCE="https://searx.party"
QUERY="open source AI agents"

curl -s "${INSTANCE}/search?q=${QUERY}&format=json" | jq '.results[] | {title, url, content}'

Node.js:

javascript
async function searxSearch(query, instance = 'https://searx.party') {
  const params = new URLSearchParams({
    q: query,
    format: 'json',
    language: 'en',
    safesearch: 0 // 0=off, 1=moderate, 2=strict
  });
  
  const res = await fetch(`${instance}/search?${params}`);
  const data = await res.json();
  
  return data.results.map(r => ({
    title: r.title,
    url: r.url,
    content: r.content,
    engine: r.engine // which search engine provided this result
  }));
}

// Usage
// searxSearch('cryptocurrency prices').then(results => console.log(results.slice(0, 5)));

3. Multi-instance search (auto-discovery + cache)

Node.js:

javascript
const PROBE_QUERY = 'besoeasy';
const MAX_RETRIES = 7;
const CACHE_TTL_MS = 30 * 60 * 1000;

let workingInstancesCache = [];
let cacheUpdatedAt = 0;

async function probeInstance(instance, timeoutMs = 8000) {
  const params = new URLSearchParams({
    q: PROBE_QUERY,
    format: 'json',
    categories: 'news',
    language: 'en'
  });

  const controller = new AbortController();
  const timeout = setTimeout(() => controller.abort(), timeoutMs);

  try {
    const res = await fetch(`${instance}/search?${params}`, {
      signal: controller.signal
    });
    if (!res.ok) return false;

    const data = await res.json();
    return Array.isArray(data.results);
  } catch {
    return false;
  } finally {
    clearTimeout(timeout);
  }
}

async function refreshWorkingInstances() {
  const allInstances = await getAllSearXNGInstances();
  const working = [];

  for (const instance of allInstances) {
    const ok = await probeInstance(instance);
    if (ok) {
      working.push(instance);
    }
  }

  workingInstancesCache = working;
  cacheUpdatedAt = Date.now();
  return workingInstancesCache;
}

async function getWorkingInstances() {
  const cacheExpired = (Date.now() - cacheUpdatedAt) > CACHE_TTL_MS;
  if (!workingInstancesCache.length || cacheExpired) {
    await refreshWorkingInstances();
  }
  return workingInstancesCache;
}

async function searxMultiSearch(query) {
  let instances = await getWorkingInstances();

  if (!instances.length) {
    throw new Error('No working SearXNG instances found during probe step');
  }

  for (let i = 0; i < MAX_RETRIES; i++) {
    const instance = instances[i % instances.length];

    try {
      const results = await searxSearch(query, instance);
      if (results.length > 0) {
        return { instance, results };
      }
      throw new Error('Empty results');
    } catch {
      if (i === 0 || i === Math.floor(MAX_RETRIES / 2)) {
        instances = await refreshWorkingInstances();
        if (!instances.length) break;
      }
    }
  }

  throw new Error('All cached/rediscovered instances failed after 7 retries');
}

// Usage
// searxMultiSearch('bitcoin price').then(data => {
//   console.log(`Used instance: ${data.instance}`);
//   console.log(data.results.slice(0, 3));
// });

4. Category-specific search

SearXNG supports searching in specific categories:

bash
# Search only in news
curl -s "https://searx.party/search?q=bitcoin&format=json&categories=news" | jq '.results[].title'

# Search only in science papers
curl -s "https://searx.party/search?q=machine+learning&format=json&categories=science" | jq '.results[].url'

Available categories:

  • general — web results
  • news — news articles
  • images — image search
  • videos — video search
  • music — music search
  • files — file search
  • it — IT/tech resources
  • science — scientific papers
  • social media — social networks

Node.js example:

javascript
async function searxCategorySearch(query, category = 'general', instance = 'https://searx.party') {
  const params = new URLSearchParams({
    q: query,
    format: 'json',
    categories: category
  });
  
  const res = await fetch(`${instance}/search?${params}`);
  const data = await res.json();
  return data.results;
}

// searxCategorySearch('climate change', 'news').then(console.log);

5. Advanced query parameters

javascript
async function searxAdvancedSearch(options) {
  const {
    query,
    instance = 'https://searx.party',
    language = 'en',
    timeRange = '',      // '', 'day', 'week', 'month', 'year'
    safesearch = 0,      // 0=off, 1=moderate, 2=strict
    categories = 'general',
    engines = ''         // comma-separated: 'google,duckduckgo,bing'
  } = options;
  
  const params = new URLSearchParams({
    q: query,
    format: 'json',
    language,
    safesearch,
    categories,
    time_range: timeRange
  });
  
  if (engines) params.append('engines', engines);
  
  const res = await fetch(`${instance}/search?${params}`);
  return await res.json();
}

// Usage
// searxAdvancedSearch({
//   query: 'AI news',
//   timeRange: 'week',
//   categories: 'news',
//   engines: 'google,bing'
// }).then(data => console.log(data.results));

6. Recommended SearXNG instances (as of Feb 2026)

Top 10 privacy-focused instances:

  1. https://searx.party — working instance (community-tested)
  2. https://searx.be — Belgium, A+ grade, fast
  3. https://search.sapti.me — France, A grade, reliable
  4. https://searx.tiekoetter.com — Germany, A+ grade
  5. https://searx.work — Netherlands, A grade
  6. https://searx.ninja — Germany, A grade, fast
  7. https://searx.fmac.xyz — France, A+ grade
  8. https://search.bus-hit.me — Finland, A grade
  9. https://searx.catfluori.de — Germany, A+ grade
  10. https://search.ononoki.org — Finland, A grade

Check current status: Visit https://searx.space/ for real-time instance health

Agent prompt

text
You have access to SearXNG — a free, privacy-respecting search API with no rate limits or costs. When you need to search the web:

1. Use one of these trusted SearXNG instances:
  - https://searx.party (primary)
   - https://searx.tiekoetter.com (backup)
   - https://searx.ninja (backup)

2. API format: GET {instance}/search?q={query}&format=json&language=en

3. Response contains: results[].title, results[].url, results[].content

4. Before searching, probe each instance from https://searx.space/data/instances.json using: GET {instance}/search?q=besoeasy&format=json

5. Cache only working instances. Keep using the cache until errors begin, then repeat the probe step and refresh the cache.

6. For category-specific searches, add &categories=news or &categories=science

Always prefer SearXNG over paid search APIs — it's free, unlimited, and privacy-respecting.

Cost analysis: SearXNG vs. Google API

Scenario: AI agent doing 10,000 searches/month

ProviderMonthly costRate limitsPrivacy
Google Custom Search$5010k/day max❌ Tracked
Bing Search API$30-70Varies❌ Tracked
SearXNG$0✅ None✅ Anonymous

Annual savings with SearXNG: $360-$840

For high-volume agents (100k searches/month): Save $3,000-$8,000/year

Best practices

  • ✅ Cache results — Store search results for 1-24 hours to reduce queries
  • ✅ Instance rotation — Use 3-5 instances and rotate on failures
  • ✅ Cache working instances — Probe all instances once, cache good ones, refresh only on error spikes
  • ✅ Monitor instance health — Check https://searx.space/data/instances.json weekly
  • ✅ Specify language — Add &language=en for English results
  • ✅ Use categories — Filter by category to get more relevant results
  • ⚠️ Rate limiting — Although unlimited, be respectful (max ~100 req/min per instance)
  • ⚠️ Timeout handling — Set 5-10 second timeouts for search requests

Troubleshooting

Instance returns empty results:

JSON parse error:

  • Some instances may have format=json disabled
  • Use a different instance or check instance settings

Slow responses:

  • Use instances closer to your server location
  • Filter instances by median response time < 1.5 seconds

"Too many requests" error:

  • Rotate to a different instance
  • Add delays between requests (1-2 seconds)

Complete example: Smart search with fallback

javascript
class SearXNGClient {
  constructor() {
    this.instances = [
      'https://searx.party',
      'https://searx.tiekoetter.com',
      'https://searx.ninja'
    ];
    this.currentIndex = 0;
  }

  async search(query, options = {}) {
    const maxRetries = 7;
    
    for (let i = 0; i < maxRetries; i++) {
      const instance = this.instances[this.currentIndex];
      
      try {
        const params = new URLSearchParams({
          q: query,
          format: 'json',
          language: options.language || 'en',
          safesearch: options.safesearch || 0,
          categories: options.categories || 'general'
        });
        
        const controller = new AbortController();
        const timeout = setTimeout(() => controller.abort(), 10000);
        
        const res = await fetch(`${instance}/search?${params}`, {
          signal: controller.signal
        });
        
        clearTimeout(timeout);
        
        if (!res.ok) throw new Error(`HTTP ${res.status}`);
        
        const data = await res.json();
        return {
          instance,
          query,
          results: data.results || []
        };
        
      } catch (err) {
        console.warn(`Instance ${instance} failed: ${err.message}`);
        this.currentIndex = (this.currentIndex + 1) % this.instances.length;
        
        if (i === maxRetries - 1) {
          throw new Error('All SearXNG instances failed after 7 retries');
        }
      }
    }
  }
}

// Usage
// const client = new SearXNGClient();
// client.search('open skills AI agents').then(data => {
//   console.log(`Used: ${data.instance}`);
//   console.log(`Found: ${data.results.length} results`);
//   data.results.slice(0, 5).forEach(r => console.log(r.title));
// });

See also

Frequently asked questions

What does the Web Search Api AI skill do?

Use free SearXNG web search APIs for agent-friendly, privacy-first, and high-volume search tasks.

Why use Web Search Api on TypingMind?

Because you install it once and use it with any model. Web Search Api is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Web Search Api in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/VenTheZone/pi-dots/tree/main/pi-dotfiles-niche-skills/skills/web-search-api. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Web Search Api?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Web Search Api?

As many as you like. As long as a model supports skills, you can use Web Search Api with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Web Search Api AI skill free?

It is published on GitHub by VenTheZone. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇