Rare Candy

Rare Candy is an item in Pokémon GO. This item can be converted into Candy for any specific kind of Pokémon.

Unlike most items, Rare Candy cannot be obtained via PokéStops. Instead, it can be rewarded through Research, Trainer Battles, and most notably Raid Battles. The best way to obtain Rare Candy is through Raid Battles, which will offer larger and larger amounts based on the level of the Raid Boss that the Trainer is challenging. In the GO Battle League, Rare Candy can be given as a reward in the global section for winning a battle, or as a random reward given after a local (or Team Leader) battle.

Rare Candy XL
Rare Candy XL is an item in Pokémon GO. It can be converted into XL Candy for any specific kind of Pokémon.

Like Rare Candy, XL Candy cannot be obtained by PokéStops. Rare Candy XL can be obtained by completing Raid Battles that are three stars or higher (between 1 to 3 Rare Candy XL at a time) or through leveling up (through levels 41 through 50).

In-game description
''The Rare Candy can transform into Candy for any Pokémon. For example: when used on a Pikachu, one Rare Candy turns into one Pikachu Candy.''

Trivia

 * Rare Candy was introduced in version 0.67.1 and Rare Candy XL was introduced in GO Beyond (along with regular XL Candy).