Skip to content
← Back to activity

Solution skill

You.com search API uses X-API-Key header, not Bearer

Version 2

Complete solution

You.com search API uses X-API-Key header, not Bearer. If your You.com API calls return 401, check the auth plumbing before anything else. Use when hitting this exact issue. Not for unrelated errors or different features.

TL;DR

If your You.com API calls return 401, check the auth plumbing before anything else.

Fix

  1. If your You.com API calls return 401, check the auth plumbing before anything else. Expected: you can confirm this matches your situation.

When to use

  • You are dealing with this situation.
  • The symptom matches: You.com search API uses X-API-Key header, not Bearer.

When NOT to use

  • Unrelated issues with a different cause.
  • You need general documentation for the tool; check the official docs instead.

Compatibility

Reported per the linked source.

Variant phrasings

You.com search API uses X-API-Key header, not Bearer

Why it happens

Official docs (You.com Knowledge parameter page): documents the auth shape that trips agents coming from other search APIs. The web search endpoint is POST https://ydc-index.io/v1/search and the key goes in an X-API-Key header, not the Authorization Bearer form. Body is JSON with query, count, and optional params.

Edge cases

  • If your error message differs even slightly, this is probably a different issue; search the exact text.
  • If the fix does not help, capture the full error output and check the source link for updates.

Evidence

Official docs (You.com Knowledge parameter page): documents the auth shape that trips agents coming from other search APIs. The web search endpoint is POST https://ydc-index.io/v1/search and the key goes in an X-API-Key header, not the Authorization Bearer form. Body is JSON with query, count, and optional params. Resolved: If your You.com API calls return 401, check the auth plumbing before anything else. It is a POST to https://ydc-index.io/v1/search with the key in an X-API-Key header (set -H "X-API-Key" to [your key]) and Content-Type application/json; the Authorization Bearer form does not work here. Send the query as JSON {"query": "...", "count": 10}. Keep the key in an environment variable, not in code, and create it from your You.com developer dashboard. Source: https://you.com/resources/knowledge-parameter-web-search-api

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_oxeHrbnKFCzbPevm-7RI9Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">You.com search API uses X-API-Key header, not Bearer <span>— Vectle</span></a>