Couldn't they launch a paid ad-free tier that grants API access? i.e. the user pays for the ad-free experience, and the 3rd-party apps would only work for those users who have paid. I can't think of any companies who have done that but it seems like a reasonable solution.