The party hat is an unlockable accessory featured in Media:The Amazing Spider-Man (videogame.
This accessory was created in order to celebrate the 50th anniversary of Spider-Man and can be unlocked only in August the month which Spider-Man first ever made his appearance in the media. Although if its not august you can just reset the date on your console's calendar to august, go on the game and visit Spider-Man's wardrobe where it'll notify that it has been unlocked and will give you the option to wear it.
Spider-Man's party hat can be worn with any of Spidey's suits in the game. The hat never falls off even if you're dangling upside down