For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Go to Platform
HomeSDKs & toolsAPI referencePricing
    • Overview
  • Build with agents
    • MCP Server
    • Skills
  • SDKs
    • Python SDK
    • TypeScript SDK
  • Integrations
    • crewAI
    • LangChain
    • LangGraph
    • n8n
    • LlamaIndex
    • OpenAI GPT OSS
    • Vercel AI SDK
    • Zapier
  • Guides
    • Developer guide
    • Build an Automated Fact Checker With You.com
LogoLogo
HomeSDKs & toolsAPI referencePricing
LogoLogo
Go to Platform
On this page
  • Quick Links
  • SDKs & Libraries
  • Python SDK
  • JavaScript/TypeScript SDK
  • Model Context Protocol (MCP)
  • Authentication
  • Get your API Key
  • Using Your API Key
  • Rate Limits & Quotas
  • Best Practices
  • 1. Use SDKs When Possible
  • 2. Implement Exponential Backoff
  • 3. Cache When Appropriate
  • 4. Handle Errors Gracefully
  • Frequently Asked Questions
  • Additional Resources
Guides

Developer guide

|View as Markdown|Open in Claude|
Was this page helpful?
Built with

Learn how to best integrate and troubleshoot the You.com API using our SDKs and MCP server.


Quick Links

Python SDK

Official Python SDK

TypeScript SDK

Official TypeScript SDK

MCP server

Model Context Protocol integration

Error reference

HTTP error codes and solutions

Get an API key
Support

Contact API support


SDKs & Libraries

Python SDK

  • Full type hints and async support
  • Automatic retry logic
  • View Documentation

JavaScript/TypeScript SDK

  • Full type hints and async support
  • Automatic retry logic
  • View Documentation

Model Context Protocol (MCP)

Integrate You.com search directly into agentic IDEs like Claude Code, Cursor, VS Code, and more:

  • Quick setup with hosted server or local NPM package
  • Works with 10+ popular development environments
  • Real-time web search for AI assistants
  • View MCP Documentation

Authentication

All API requests require authentication using an API key.

Get your API Key

  1. Visit the You.com platform
  2. Create a new API key
  3. Copy and store it securely

Using Your API Key

Include your API key in the request header:

1curl --request GET \
2 --url 'https://ydc-index.io/v1/search?query=example' \
3 --header 'X-API-Key: api_key'

Security Best Practice: Never commit API keys to version control. Use environment variables or secure secret management systems.


Rate Limits & Quotas

API usage is subject to rate limits based on your subscription tier:

  • Free Tier: Limited requests per day
  • Paid Tiers: Higher limits based on plan

Rate limit details are included in response headers:

  • X-RateLimit-Limit - Total requests allowed
  • X-RateLimit-Remaining - Requests remaining
  • X-RateLimit-Reset - Time when limit resets (Unix timestamp)

When you exceed rate limits, you’ll receive a 429 Too Many Requests response.

Handling Rate Limits:

1import time
2import requests
3
4def make_request_with_retry(url, headers):
5 response = requests.get(url, headers=headers)
6
7 if response.status_code == 429:
8 retry_after = int(response.headers.get('Retry-After', 60))
9 print(f"Rate limited. Retrying after {retry_after} seconds...")
10 time.sleep(retry_after)
11 return make_request_with_retry(url, headers)
12
13 return response

For higher rate limits, upgrade your plan or contact [email protected].


Best Practices

1. Use SDKs When Possible

SDKs handle authentication, retries, and error handling automatically:

1# ✅ Good: Using SDK
2import os
3from youdotcom import You
4
5with You(api_key_auth=os.getenv("api_key")) as you:
6 response = you.search.unified(query="example")
7
8# ❌ Less ideal: Manual requests
9import requests
10response = requests.get(
11 "https://ydc-index.io/v1/search",
12 params={"query": "example"},
13 headers={"X-API-Key": os.getenv("api_key")}
14)

2. Implement Exponential Backoff

For retry logic, use exponential backoff to avoid overwhelming the API:

1import time
2from youdotcom import You, errors
3
4def exponential_backoff(attempt):
5 return min(2 ** attempt, 60) # Max 60 seconds
6
7with You(api_key_auth="api_key") as you:
8 for attempt in range(5):
9 try:
10 response = you.search.unified(query="test")
11 break
12 except errors.YouError as e:
13 if e.status_code == 429 and attempt < 4:
14 wait_time = exponential_backoff(attempt)
15 time.sleep(wait_time)
16 else:
17 raise

3. Cache When Appropriate

Cache search results for frequently asked questions:

1from functools import lru_cache
2from youdotcom import You
3
4you = You(api_key_auth="api_key")
5
6@lru_cache(maxsize=100)
7def cached_search(query: str):
8 return you.search.unified(query=query)

4. Handle Errors Gracefully

Always provide fallback behavior:

1from youdotcom import You, errors
2
3with You(api_key_auth="api_key") as you:
4 try:
5 response = you.search.unified(query=user_query)
6 except errors.YouError as e:
7 if e.status_code == 401:
8 print("Configuration error. Please check your API key.")
9 elif e.status_code == 429:
10 print("Too many requests. Please try again in a moment.")
11 else:
12 print(f"API error: {e.message}")

Frequently Asked Questions

How do I get an API key?

Visit you.com/platform to create and manage API keys. You’ll need to sign up for a You.com account and select a plan.

What are the rate limits?

Rate limits vary by subscription tier. Free tier has limited daily requests, while paid tiers offer higher limits. Check your current usage and limits in the API Console.

Can I use the API in production?

Yes! The You.com API is production-ready. We recommend using our official SDKs, implementing proper error handling, and monitoring your usage to stay within rate limits.

Do you offer technical support?

Yes! Email [email protected] for technical support, feature requests, or partnership inquiries. For bugs or issues with SDKs, you can also open issues on our GitHub repositories.

Can I use this for commercial projects?

Yes, the You.com API can be used for commercial projects. Check our terms of service for details, or contact [email protected] for enterprise licensing.

Is there a sandbox environment for testing?

All API keys can be used for testing and development. We recommend using a separate API key for development vs. production to track usage independently.


Additional Resources

Quickstart guide

Get started in 5 minutes

API reference

Complete endpoint documentation

Search operators

Advanced search syntax