Metadata-Version: 2.4
Name: metasearch-client
Version: 0.1.0
Summary: Python client for Metasearch - search 200+ engines with AI answers
Project-URL: Homepage, https://github.com/zeus-kim/metasearch
Project-URL: Documentation, https://github.com/zeus-kim/metasearch#api-endpoints
Project-URL: Repository, https://github.com/zeus-kim/metasearch
Author-email: Zeus Kim <zeus@zeus.kim>
License-Expression: MIT
Keywords: ai,llm,metasearch,privacy,search
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
Requires-Python: >=3.9
Requires-Dist: requests>=2.28.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Description-Content-Type: text/markdown

# metasearch-client

Python client for [Metasearch](https://github.com/zeus-kim/metasearch) - search 200+ engines with AI answers.

## Installation

```bash
pip install metasearch-client
```

## Quick Start

```python
from metasearch_client import Metasearch

# Connect to local instance
ms = Metasearch("http://localhost:8889")

# Search
results = ms.search("Rust async programming")
for r in results[:5]:
    print(f"{r.title} - {r.url}")

# AI Answer with citations
answer = ms.answer("What is the difference between Rust and Go?")
print(answer.text)
for cite in answer.citations:
    print(f"  [{cite['index']}] {cite['title']}")

# News feed
news = ms.discover(lang="ko", category="tech")
for article in news[:5]:
    print(f"{article['title']} - {article['source']}")

# Trending topics
trends = ms.trending(geo="KR")
for t in trends[:10]:
    print(t["title"])
```

## API Reference

### `Metasearch(base_url, timeout=30)`

Create a client instance.

### Methods

| Method | Description |
|--------|-------------|
| `search(query, categories, lang, page)` | Search across engines |
| `answer(query, focus, model, stream)` | Get AI-grounded answer |
| `research(query, focus, deep)` | Deep research with subqueries |
| `discover(lang, category, limit)` | Curated news feed |
| `trending(geo)` | Trending topics |
| `images(query, lang)` | Image search |
| `news_digest(query, lang)` | AI news summary |
| `health()` | Server health check |

### Focus modes for `answer()`

- `general` - Balanced answer
- `academic` - Scholarly sources
- `code` - Programming focus
- `news` - Recent events

## License

MIT
