Before You Get Started

To use the You.com News API, you will need an API key. Please visit api.you.com for more details.

Getting Started with News Results

main.py
import requests

def get_ai_snippets_for_query(query):
    headers = {"X-API-Key": YOUR_API_KEY}
    params = {"query": query}
    return requests.get(
        f"https://api.ydc-index.io/news?q={query}",
        params=params,
        headers=headers,
    ).json()
results = get_ai_snippets_for_query("joe biden")

The above will return a list of search results, such as the below:

results.json
{'news': {'results': [{'age': '5 hours ago',
    'breaking': False,
    'description': 'President Joe Biden’s task, as he looked America in the eye from the Oval Office, was to explain why a nation wearied by its own foreign quagmires and political estrangements should send $100 billion to help other people fight their wars.',
    'family_friendly': True,
    'is_source_both': False,
    'is_source_local': False,
    'meta_url': {'hostname': 'www.cnn.com',
     'netloc': 'cnn.com',
     'path': '› 20231020  › politics  › takeaway-biden-address-israel-ukraine-aid  › index.html',
     'scheme': 'https'},
    'thumbnail': {},
    'title': "Analysis: The number one takeaway from Joe Biden's Oval Office address on Israel and Ukraine | CNN Politics",
    'url': 'https://www.cnn.com/2023/10/20/politics/takeaway-biden-address-israel-ukraine-aid/index.html'},
   {'age': '2 hours ago',
    'breaking': False,
    'description': 'Trump, the most likely challenger to Biden in next year’s election, poured scorn on his efforts. His campaign said in a statement: “As America stumbles ever closer to World War III, Joe Biden is Neville Chamberlain trying to pose as Winston Churchill.',
    'family_friendly': True,
    'is_source_both': False,
    'is_source_local': False,
    'meta_url': {'hostname': 'www.theguardian.com',
     'netloc': 'theguardian.com',
     'path': '› us-news  › 2023  › oct  › 20  › joe-biden-tv-address-to-nation-oval-office-speech-vladimir-putin-hamas-aid-for-israel-ukraine',
     'scheme': 'https'},
    'thumbnail': {},
    'title': 'Biden draws direct link between Putin and Hamas as he urges aid for Israel and Ukraine | Joe Biden | The Guardian',
    'url': 'https://www.theguardian.com/us-news/2023/oct/20/joe-biden-tv-address-to-nation-oval-office-speech-vladimir-putin-hamas-aid-for-israel-ukraine'},
   {'age': '3 hours ago',
    'breaking': False,
    'description': "U.S. President Joe Biden, accompanied by Vice President Kamala Harris and U.S. Secretary of State Antony Blinken, makes remarks after speaking by phone with Israeli Prime Minister Benjamin Netanyahu about the situation in Israel following Hamas' deadly attacks, from the State Dining Room at ...",
    'family_friendly': True,
    'is_source_both': False,
    'is_source_local': False,
    'meta_url': {'hostname': 'www.cnbc.com',
     'netloc': 'cnbc.com',
     'path': '› 20231020  › biden-seeks-105-billion-for-ukraine-israel-taiwan-border.html',
     'scheme': 'https'},
    'thumbnail': {},
    'title': 'Biden seeks $105 billion for Ukraine, Israel, Taiwan, border security',
    'url': 'https://www.cnbc.com/2023/10/20/biden-seeks-105-billion-for-ukraine-israel-taiwan-border.html'},
   {'age': '3 hours ago',
    'breaking': False,
    'description': 'The central Republican attack line on Joe Biden has always been that he is not in charge of his own administration. But Biden’s hawkish policy on Israel and Hamas, which has drawn protests from progressive staff, proves otherwise.',
    'family_friendly': True,
    'is_source_both': False,
    'is_source_local': False,
    'meta_url': {'hostname': 'nymag.com',
     'netloc': 'nymag.com',
     'path': '› intelligencer  › 202310  › bidens-israel-policy-proves-hes-running-his-administration.html',
     'scheme': 'https'},
    'thumbnail': {},
    'title': 'It Turns Out Joe Biden Is Actually In Charge of the Biden Administration',
    'url': 'https://nymag.com/intelligencer/2023/10/bidens-israel-policy-proves-hes-running-his-administration.html'},
   {'age': '6 hours ago',
    'breaking': False,
    'description': 'Biden discussed the U.S. response to the Hamas-Israel conflict, humanitarian assistance in Gaza and the continued support for Ukraine during Russia’s ongoing invasion. (Jonathan Ernst - Pool/Getty Images) Joe Concha, a Fox News contributor, recalled that during the speech, Biden gave himself ...',
    'family_friendly': True,
    'is_source_both': False,
    'is_source_local': False,
    'meta_url': {'hostname': 'www.foxnews.com',
     'netloc': 'foxnews.com',
     'path': '› politics  › republicans-respond-bidens-oval-office-speech-mentioned-ukraine-hamas-israel-war-unbelievable',
     'scheme': 'https'},
    'thumbnail': {},
    'title': "Republicans respond to Biden's Oval Office speech that mentioned Ukraine, Hamas-Israel war: 'Unbelievable'",
    'url': 'https://www.foxnews.com/politics/republicans-respond-bidens-oval-office-speech-mentioned-ukraine-hamas-israel-war-unbelievable'},
   {'age': '5 hours ago',
    'breaking': False,
    'description': 'Lawmakers reacted after President ... night speech, with many praising the president’s words on the current foreign conflicts. “Tonight, President Joe Biden masterfully presented the case…...',
    'family_friendly': True,
    'is_source_both': False,
    'is_source_local': False,
    'meta_url': {'hostname': 'thehill.com',
     'netloc': 'thehill.com',
     'path': '› homenews  › house  › 4266272-lawmakers-react-to-bidens-oval-office-address',
     'scheme': 'https'},
    'thumbnail': {},
    'title': 'Lawmakers react to Biden’s Oval Office address | The Hill',
    'url': 'https://thehill.com/homenews/house/4266272-lawmakers-react-to-bidens-oval-office-address/'},
   {'age': '14 hours ago',
    'breaking': False,
    'description': 'President Joe Biden will ask Congress for money to support Israel, Ukraine and bulk up U.S. border security.',
    'family_friendly': True,
    'is_source_both': False,
    'is_source_local': False,
    'meta_url': {'hostname': 'www.usatoday.com',
     'netloc': 'usatoday.com',
     'path': '› story  › news  › world  › 20231019  › biden-congress-funding-israel-ukraine-border-security  › 71240318007',
     'scheme': 'https'},
    'thumbnail': {},
    'title': 'In Oval Office address, Biden makes the case for more aid to Israel, Ukraine',
    'url': 'https://www.usatoday.com/story/news/world/2023/10/19/biden-congress-funding-israel-ukraine-border-security/71240318007/'},
   {'age': '6 hours ago',
    'breaking': False,
    'description': "President Joe Biden launched a new mission to convince Americans they should spend billions more on supporting Israel and Ukraine in their wars, arguing that only the U.S.'s involvement can prevent global chaos.",
    'family_friendly': True,
    'is_source_both': False,
    'is_source_local': False,
    'meta_url': {'hostname': 'www.reuters.com',
     'netloc': 'reuters.com',
     'path': '› world  › biden-press-us-role-primetime-address-ukraine-israel-2023-10-19',
     'scheme': 'https'},
    'thumbnail': {},
    'title': "US leadership 'holds the world together,' Biden says in bid for Ukraine, Israel funds | Reuters",
    'url': 'https://www.reuters.com/world/biden-press-us-role-primetime-address-ukraine-israel-2023-10-19/'},
   {'age': '2 days ago',
    'breaking': False,
    'description': 'It took an explicit commitment from his Israeli counterpart to open Gaza for humanitarian aid for President Joe Biden to agree to make an extraordinary wartime trip to Tel Aviv.',
    'family_friendly': True,
    'is_source_both': False,
    'is_source_local': False,
    'meta_url': {'hostname': 'www.cnn.com',
     'netloc': 'cnn.com',
     'path': '› 20231017  › politics  › inside-joe-biden-israel-trip-planning  › index.html',
     'scheme': 'https'},
    'thumbnail': {},
    'title': 'How Joe Biden got on board with a wartime trip to Israel -- and what he hopes to accomplish | CNN Politics',
    'url': 'https://www.cnn.com/2023/10/17/politics/inside-joe-biden-israel-trip-planning/index.html'}],
  'type': 'news'},
 'query': {'bad_results': False,
  'city': '',
  'country': 'us',
  'header_country': '',
  'is_navigational': True,
  'is_news_breaking': True,
  'local_decision': 'drop',
  'local_locations_idx': 0,
  'more_results_available': True,
  'original': 'joe biden',
  'postal_code': '',
  'should_fallback': False,
  'show_strict_warning': False,
  'spellcheck_off': True,
  'state': ''},
 'type': 'search'}