Introduction

Welcome to the Quickstart Guide for integrating comprehensive, high-quality answers with precise and reliable citations using our Smart, Research, Search and News APIs. This guide will walk you through the initial setup and provide you with sample code to perform searches and retrieve results.

Step 1: Set Up Your API Key

Before You Get Started

To use the You.com Smart, Research, Search and News LLM endpoints, you can get an API key through the self-serve portal at api.you.com. For support, please reach out via email at api@you.com.

Replace X-API-Key in the code with your actual API key:

API Key
YOUR_API_KEY = "your_actual_api_key_here"

Step 2: Write the Search Function

Create a function to interact with the Research API:

Learn more about the Smart API .
smart_api.py
import requests

def get_smart_results(query):
    headers = {"X-API-Key": YOUR_API_KEY}
    params = {"query": query, "instructions": instructions}
    return requests.get(
        "https://chat-api.you.com/smart?query={query}",
        params=params,
        headers=headers,
    ).json()

Use the function to search for AI snippets related to a specific topic:

smart_results.py
get_smart_results("Who won the Nobel Prize in Physics in 2024?")

Explore our APIs

Unlock new possibilities with our suite of advanced APIs tailored to meet your needs and explore more use cases.