Developer Resources

Dev

Overview

This section provides essential tools, references, and resources to help you integrate and troubleshoot the You.com API effectively.



SDKs & Libraries

Python SDK

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: YOUR_API_KEY'

For Agent APIs, use Bearer token authentication:

1curl -N \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -X POST https://api.you.com/v1/agents/runs \
5 -d '{"agent": "express", "input": "test", "stream": true}'

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
2from youdotcom import YouClient
3client = YouClient(api_key=os.getenv("YDC_API_KEY"))
4response = client.search(query="example")
5
6# ❌ Less ideal: Manual requests
7import requests
8response = requests.get(
9 "https://ydc-index.io/v1/search",
10 params={"query": "example"},
11 headers={"X-API-Key": os.getenv("YDC_API_KEY")}
12)

2. Implement Exponential Backoff

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

1import time
2
3def exponential_backoff(attempt):
4 return min(2 ** attempt, 60) # Max 60 seconds
5
6for attempt in range(5):
7 try:
8 response = client.search(query="test")
9 break
10 except RateLimitError:
11 if attempt < 4:
12 wait_time = exponential_backoff(attempt)
13 time.sleep(wait_time)
14 else:
15 raise

3. Use Streaming for Agents

Provide better UX by streaming agent responses:

1# ✅ Good: Stream responses for real-time feedback
2for chunk in client.agents.express_stream(input="query"):
3 if chunk.type == "response.output_text.delta":
4 print(chunk.delta, end="", flush=True)
5
6# ❌ Less ideal: Wait for complete response
7response = client.agents.express(input="query")
8print(response.answer) # User waits entire time

4. Cache When Appropriate

Cache search results for frequently asked questions:

1from functools import lru_cache
2
3@lru_cache(maxsize=100)
4def cached_search(query: str):
5 return client.search(query=query)

5. Handle Errors Gracefully

Always provide fallback behavior:

1try:
2 response = client.search(query=user_query)
3except AuthenticationError:
4 return "Configuration error. Please contact support."
5except RateLimitError:
6 return "Too many requests. Please try again in a moment."
7except APIError as e:
8 logger.error(f"API error: {e}")
9 return "Unable to complete search. Please try again."

Frequently Asked Questions

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

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.

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.

Custom agents must be created via the You.com UI. Once created, you’ll receive an agent ID that can be used with the Custom Agent API.

The Search API returns raw web results, while Agents synthesize information and provide natural language answers with citations. Use Search API for building custom UIs, and Agents for conversational experiences.

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.

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.

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.


Support & Community

Get Help

Stay Updated


Additional Resources