Skip to main content

How to change social media preview (Open Graph metadata) via API

Using the Short.io API features you can change the generated preview data of a link that you share on social networks.

Note

The Social media preview is available starting from the Pro plan.

Before you begin, make sure you have created an API key.

To update social media preview

  1. Sign in to your Short.io account.

  2. Browse the opengraph properties page.

  3. In the Path params section provide the needed data:

    • domainId - the unique identifier of your domain

    • linkId - the unique identifier of your short link

    Note

    You can find information on how to retrieve the above parameters in the following article.

  4. Navigate to the Body params section and click on + to Add array of strings:

  5. Enter as much parameters and their values as needed, for example:

    • [ "description", "This is my online store" ]

    • [ "image", "<your-image-URL>" ]

    • [ "twitter:card", "summary" ]

    Note

    You can review the full list of parameters here.

  6. Navigate to the Credentials section and enter your authorization key:

  7. Click on Try it!.

  8. In the Response panel you can review the result:

  9. Sign in to your Short.io account.

  10. From the Branded links menu click onto edit the short link which you updated via the API:

  11. Navigate to the Social media menu to review the new values:

You can then use the Facebook's Sharing Debugger to check how the link's preview looks after you added the Open Graph settings.

Full list of parameters, descriptions and expected values

Below is a list in alphabetical order of all the parameters, descriptions and expected values (if applicable) that can be set as social media metadata:

ParameterDescription / Expected value
audioURL to an audio file
descriptionPage description
determinerA, an or the
image:altDescription of what is in the image
image:heightImage height
image:widthImage width
image:typeImage MIME type
imageImage URL
localeLocale of the page
locale:alternateAlternate locals of the page
site_nameWebsite name
titlePage title
twitter:app:countryX/Twitter app country
twitter:app:url:googleplayYour app URL in Google Play
twitter:app:id:googleplayYour app ID in Google Play
twitter:app:name:googleplayName of your app in Google Play
twitter:app:url:ipadYour iPad app URL in Apple Store
twitter:app:id:ipadYour iPad app ID in Apple Store
twitter:app:name:ipadName of your iPad app in Apple Store
twitter:app:url:iphoneYour iPhone app URL in Apple Store
twitter:app:id:iphoneYour iPhone
twitter:app:name:iphoneName of your iPhone app in Apple Store
twitter:player:streamURL to raw video or audio stream
twitter:player:heightHeight of iframe in pixels
twitter:player:widthWidth of iframe in pixels
twitter:playerHTTPS URL of player iframe
twitter:image:altA text description of the image
twitter:imageURL of image to use in the card
twitter:titleTitle of content (max 70 characters)
twitter:descriptionDescription of content (max 200 characters)
twitter:creator:idX/Twitter user ID of content creator
twitter:creator@username of content creator
twitter:site:idX/Twitter website ID
twitter:site@username of website
twitter:cardThe X card type
typePage type: article, book, profile, website, music.song, music.album, music.playlist, music.radio_station, video.movie, video.episode, video.tv_show, video.other
urlCanonical URL of your object