Unexpected behavior in API call response

Xaekai
My Little Pony - 1992 Edition
The Magic of Friendship Grows - For helping others attend the 2020 Community Collab
Friendship, Art, and Magic (2020) -
Wallet After Summer Sale -
Friendship, Art, and Magic (2019) - Celebrated Derpibooru's seventh year anniversary with friends.
Friendship, Art, and Magic (2018) - Celebrated Derpibooru's six year anniversary with friends.
Responsible Disclosure - ZERO​WIDTH​SPACES
Not a Llama - Happy April Fools Day!
Magnificent Metadata Maniac - #1 Assistant
Squirrel - "There are better things to WOOP WOOP to"

Mo​dular Ponkfag
Yeah, but an HTML page 302’ing to an HTML page isn’t really that unexpected. Getting not-JSON from a JSON API call is annoying.
Damaged
Non-Fungible Trixie -
Fine Arts - Two hundred uploads with a score of over a hundred (Safe/Suggestive)
Perfect Pony Plot Provider - Uploader of 10+ images with 350 upvotes or more (Questionable/Explicit)
Notoriously Divine Tagger - Consistently uploads images above and beyond the minimum tag requirements. And/or additionally, bringing over the original description from the source if the image has one. Does NOT apply to the uploader adding several to a dozen tags after originally uploading with minimum to bare tagging.
Magnificent Metadata Maniac -
Wallet After Summer Sale -
Equality - In our state, we do not stand out.
Magical Inkwell - Wrote MLP fanfiction consisting of at least around 1.5k words, and has a verified link to the platform of their choice
Not a Llama - Happy April Fools Day!
Happy Derpy! - For Patreon supporters

Word Bug
@Xaekai  
I’ll point out that you need to make your code allow for HTML responses at any time. When the site is put into anti-DDoS protection, you will always get HTML back from API.
 
I’d suggest checking the server’s response headers for the content type and accounting for such issues with a graceful timeout/failure mode.
Interested in advertising on Derpibooru? Click here for information!
Techy Cutie Pony Collection!

Help fund the $15 daily operational cost of Derpibooru - support us financially!

Syntax quick reference: **bold** *italic* ||hide text|| `code` __underline__ ~~strike~~ ^sup^ %sub%

Detailed syntax guide