> ## Documentation Index
> Fetch the complete documentation index at: https://www.ayrshare.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# YouTube Categories

> Retrieve the YouTube categories ids for a given region

export const HeaderAPI = ({noProfileKey, profileKeyRequired}) => <>
    <ParamField header="Authorization" type="string" required>
      <a href="/apis/overview#authorization">API Key</a> of the Primary Profile.
      <br />
      <br />
      Format: <code>Authorization: Bearer API_KEY</code>
    </ParamField>
    {!noProfileKey && (profileKeyRequired ? <ParamField header="Profile-Key" type="string" required>
          <a href="/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField> : <ParamField header="Profile-Key" type="string">
          <a href="/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField>)}
  </>;

export const PlansAvailable = ({plans = [], maxPackRequired}) => {
  let displayPlans = plans;
  if (plans && plans.length === 1) {
    const lowerCasePlan = plans[0].toLowerCase();
    if (lowerCasePlan === "basic") {
      displayPlans = ["Basic", "Premium", "Business", "Enterprise"];
    } else if (lowerCasePlan === "business") {
      displayPlans = ["Business", "Enterprise"];
    } else if (lowerCasePlan === "premium") {
      displayPlans = ["Premium", "Business", "Enterprise"];
    }
  }
  return <Note>
Available on {displayPlans.length === 1 ? "the " : ""}
{displayPlans.join(", ").replace(/\b\w/g, l => l.toUpperCase())}{" "}
{displayPlans.length > 1 ? "plans" : "plan"}.

{maxPackRequired && <span onClick={() => window.open('https://www.ayrshare.com/docs/additional/maxpack', '_self')} className="flex items-center mt-2 cursor-pointer">
 <span className="px-1.5 py-0.5 rounded text-sm" style={{
    backgroundColor: '#C264B6',
    color: 'white',
    fontSize: '12px'
  }}>
   Max Pack required
 </span>
</span>}
</Note>;
};

<PlansAvailable plans={["premium"]} maxPackRequired={false} />

Retrieve the YouTube categories ids for a given region. The category ID can be set in the POST or PATCH /post endpoints.

For example, `GET https://api.ayrshare.com/api/youTubeCategories/US` for the U.S. video categories.

<Warning>
  YouTube only allows certainly categories to be assigned by a user.
  Only categories where assignable is `true` can be set in the POST or PATCH /post endpoints when creating a YouTube post.

  Other categories, which are not assignable and have `assignable: false`, will result in an error.
</Warning>

## Header Parameters

<HeaderAPI />

## Path Parameters

<ParamField path="region" type="string" required>
  Two letter [country code](/iso-codes/country) of the region.
</ParamField>

<ResponseExample>
  ```json 200: OK Retrieved Categories theme={"system"}
  {
      "region": "US",
      "categories": [
          {
              "id": "1",
              "title": "Film & Animation",
              "assignable": true
          },
          {
              "id": "10",
              "title": "Music",
              "assignable": true
          },
          {
              "id": "15",
              "title": "Pets & Animals",
              "assignable": true
          },
          {
              "id": "17",
              "title": "Sports",
              "assignable": true
          },
          {
              "id": "18",
              "title": "Short Movies",
              "assignable": false
          },
          {
              "id": "19",
              "title": "Travel & Events",
              "assignable": true
          },
          {
              "id": "2",
              "title": "Autos & Vehicles",
              "assignable": true
          },
          {
              "id": "20",
              "title": "Gaming",
              "assignable": true
          },
          {
              "id": "21",
              "title": "Videoblogging",
              "assignable": false
          },
          {
              "id": "22",
              "title": "People & Blogs",
              "assignable": true
          },
          {
              "id": "23",
              "title": "Comedy",
              "assignable": true
          },
          {
              "id": "24",
              "title": "Entertainment",
              "assignable": true
          },
          {
              "id": "25",
              "title": "News & Politics",
              "assignable": true
          },
          {
              "id": "26",
              "title": "Howto & Style",
              "assignable": true
          },
          {
              "id": "27",
              "title": "Education",
              "assignable": true
          },
          {
              "id": "28",
              "title": "Science & Technology",
              "assignable": true
          },
          {
              "id": "29",
              "title": "Nonprofits & Activism",
              "assignable": true
          },
          {
              "id": "30",
              "title": "Movies",
              "assignable": false
          },
          {
              "id": "31",
              "title": "Anime/Animation",
              "assignable": false
          },
          {
              "id": "32",
              "title": "Action/Adventure",
              "assignable": false
          },
          {
              "id": "33",
              "title": "Classics",
              "assignable": false
          },
          {
              "id": "34",
              "title": "Comedy",
              "assignable": false
          },
          {
              "id": "35",
              "title": "Documentary",
              "assignable": false
          },
          {
              "id": "36",
              "title": "Drama",
              "assignable": false
          },
          {
              "id": "37",
              "title": "Family",
              "assignable": false
          },
          {
              "id": "38",
              "title": "Foreign",
              "assignable": false
          },
          {
              "id": "39",
              "title": "Horror",
              "assignable": false
          },
          {
              "id": "40",
              "title": "Sci-Fi/Fantasy",
              "assignable": false
          },
          {
              "id": "41",
              "title": "Thriller",
              "assignable": false
          },
          {
              "id": "42",
              "title": "Shorts",
              "assignable": false
          },
          {
              "id": "43",
              "title": "Shows",
              "assignable": false
          },
          {
              "id": "44",
              "title": "Trailers",
              "assignable": false
          }
      ]
  }.
  .
  ```

  ```json 400: Incorrect Region Code theme={"system"}
  {
    "action": "request",
    "status": "error",
    "code": 101,
    "message": "Missing or incorrect parameters. Please verify with the docs. .../ayrshare.com/rest-api/endpoints"
  }
  ```
</ResponseExample>
