Sign inSign up

goldpulpy/web-search-api

By goldpulpy

•Updated 10 months ago

A simple web search API that scrapes search engines and returns clean JSON data.

Image
Web servers
1

316

goldpulpy/web-search-api repository overview

⁠🔎 Web Search API

Web Search API is a lightweight and fast FastAPI-based web search service. It uses Playwright for reliable web scraping and returns clean, structured JSON results.

GitHub⁠


⁠Quick Start

⁠Run with Docker
docker run -p 5000:5000 goldpulpy/web-search-api:latest

With API Key enabled:

docker run -p 5000:5000 \
  -e API_KEY=your-secret-key \
  goldpulpy/web-search-api:latest

The API will be available at:

http://localhost:5000

⁠API Documentation

Once the container is running, the interactive docs are available at:

http://localhost:5000/docs

⁠Environment Variables

VariableDefaultDescription
HOST0.0.0.0Server host
PORT5000API port
LOG_LEVELINFOLogging level
API_KEYNoneAPI key for protected endpoints (optional)
API_PREFIX/apiAPI route prefix
ENABLE_DOCStrueEnable API documentation

⁠Example Requests

⁠Get available search engines
curl http://localhost:5000/api/v1/engines
curl -X POST http://localhost:5000/api/v1/search \
  -H "Content-Type: application/json" \
  -d '{
    "engine": "DuckDuckGo",
    "query": "FastAPI search API",
    "page": 1
  }'

If API key auth is enabled:

-H "Authorization: Bearer YOUR_API_KEY"

⁠Docker Compose Example

version: "3.8"

services:
  web-search-api:
    image: goldpulpy/web-search-api:latest
    container_name: web-search-api
    environment:
      - API_KEY=your-secret-key
    ports:
      - "5000:5000"
    restart: unless-stopped
    mem_limit: 512m
    cpus: 0.5
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:5000/health"]
      interval: 30s
      timeout: 10s
      retries: 3

Tag summary

Content type

Image

Digest

sha256:cc1926899…

Size

433.4 MB

Last updated

10 months ago

docker pull goldpulpy/web-search-api