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

# [Campaigns] Get Campaign Categories

export const EndpointBadge = ({method = "GET", children}) => {
  const METHOD_STYLES = {
    GET: {
      bg: "mint-bg-[#2AB673]"
    },
    POST: {
      bg: "mint-bg-[#3064E3]"
    },
    PUT: {
      bg: "mint-bg-[#C28C30]"
    },
    PATCH: {
      bg: "mint-bg-[#DA622B]"
    },
    DELETE: {
      bg: "mint-bg-[#CB3A32]"
    },
    API: {
      bg: "mint-bg-black"
    }
  };
  const key = method.toUpperCase();
  const styles = METHOD_STYLES[key] ?? METHOD_STYLES.API;
  return <div className="relative mt-7">
      <span className={`absolute -top-2 -left-2 z-10 ${styles.bg} text-white px-2.5 py-0.5 rounded-full text-xs font-bold tracking-wide`}>
        {key}
      </span>
      {children}
    </div>;
};

## **Retrieve Categories for a Campaign**

The categories associated with a specific campaign can be retrieved via a `GET` request to the `/campaigns` endpoint, with the campaign ID as a URL parameter and `/categories` specified.

<EndpointBadge method="get">
  ```http theme={null}
  https://api.criteo.com/legacy/marketing/v1/campaigns/{campaignId}/categories
  ```
</EndpointBadge>

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.criteo.com/legacy/marketing/v1/campaigns/1234/categories \
    --header 'Accept: application/json'
  ```
</CodeGroup>

The same request can be achieved with a `GET` request to the `/categories` endpoint and including a `campaignIds` query parameter :

<EndpointBadge method="get">
  ```http theme={null}
  https://api.criteo.com/legacy/marketing/v1/categories
  ```
</EndpointBadge>

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.criteo.com/legacy/marketing/v1/categories?campaignIds=1234' \
    --header 'Accept: application/json'
  ```
</CodeGroup>

The API will return an array of categories associated with the campaign:

<CodeGroup>
  ```json JSON theme={null}
  [
    {
      categoryHashCode: 9876543,
      categoryName: 'cat-one',
      catalogId: 76543,
      catalogName: 'full-inventory',
      advertiserId: 1,
      advertiserName: 'Advertiser US',
      campaignId: 1234,
      campaignName: 'Web Conversion - Retargeting',
      averagePrice: 250.22,
      numberOfProducts: 151,
      categoryBid: { bidValue: 1.1, bidCurrency: 'USD', bidType: 'CPC' },
      enabled: true
    }
   ]
  ```
</CodeGroup>

 

## **Retrieve a Single Category for a Campaign**

A single category can be retrieved for a specific campaign by making a `GET` request to the `/campaigns` endpoint for a specific campaign ID, and adding the `/categories` path with a particular category hash ID:

<EndpointBadge method="get">
  ```http theme={null}
  https://api.criteo.com/legacy/marketing/v1/campaigns/{campaignId}/categories/{categoryId}
  ```
</EndpointBadge>

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.criteo.com/legacy/marketing/v1/campaigns/1234/categories/9876543 \
    --header 'Accept: application/json'
  ```
</CodeGroup>

As above, an equivalent request can be constructed to the `/categories` endpoint by specifying `campaignIds` and `categoryHashCodes` query parameters:

<EndpointBadge method="get">
  ```http theme={null}
  https://api.criteo.com/legacy/marketing/v1/categories
  ```
</EndpointBadge>

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.criteo.com/legacy/marketing/v1/categories?campaignIds=1234&categoryHashCodes=9876543' \
    --header 'Accept: application/json'
  ```
</CodeGroup>

***

**What’s Next**

Manage categories by enabling, disabling and adjusting bids

* [Update Category-Level Bids and Manage Active Categories](/marketing-solutions/v2020.07/docs/update-category-level-bids-and-manage-active-categories)
