Today, we’re launching the media alt_text field for all Twitter API v2 endpoints that deliver media objects in order to enable developers to build more consciously for accessibility. This new field allows you to request media data using the media.fields parameter.
When people Tweet photos, they have the option to compose an alt text description of the image so the content is accessible to more people, including those who are blind or low-vision. Twitter allows you to add up to 1000 characters of alt text to each photo that you attach to a Tweet.
To request this field, you must pass the expansions=attachments.media_keys parameter, as well as the media.fields=alt_text parameter. If included in your request, this field will return the alt text for any Tweets that include images with alt text. You can learn more about this functionality from our api reference pages such as Tweet lookup, or from our media objects page.
If you have any questions, please let us know via the Twitter API v2 forum category.
6 Likes