That's the thing isn't it. Obviously you can serve extra "note: 'service is about to shutdown'" in your JSON, but since it's an API a lot of people aren't going to be seeing it. I guess best option would have been to collect everyone's email addresses using the service and email them, but it might have been flagged as spam.
Imo two weeks is plenty of time since you probably shouldn't be using free services like this in any actual product (or at least not without a backup or at very least proper logging)