Social Media Assets Generation

Resizes and creates images with all appropriate sizes for any social media service.
curl --request GET \
--url 'https://api.apilayer.com/social_asset/facebook/url?url={url}' \
--header 'apikey: dq2TlGLIDrBh1OHx0o7umAtVyyhNzFrE'
{"message":"No sample response available for this endpoint yet."}

Image generator for social networks such as;

  • Instagram
  • Twitter
  • Facebook
  • Linkedin
  • YouTube
  • Pinterest
  • Tumblr

What this API does ?

Resizes and creates appropriate social network images for given service and returns resized image’s url. You can pass the orientation parameter for each service for the intended image format.

For improper image sizes, api crops images from center point.

Valid / Supported Orientation Values

Instagram

Default value is set to : square

  • square: 1080×1080
  • landscape: 1080×566
  • portrait: 1080×1350
  • profile: 110×110
  • story: 1080×1920
Twitter

Default value is set to : profile

  • profile: 400×400
  • header: 1500×500
  • image: 1024×512
  • card: 1200×628
  • ad: 800×428
Facebook

Default value is set to : profile

  • profile: 180×180
  • cover: 820×462
  • link: 1200×630
  • image: 1200×630
  • event: 1920×1080
  • ad: 1200×628
  • storyad: 1080×1920
  • groupcover: 1640×922
  • messengerad: 1200×628
Linkedin

Default value is set to : profile

  • profile: 400×400
  • background: 1584×396
  • postdesktop: 1200×1200
  • postmobile: 1200×628
  • post: 1200×628
  • companylogo: 300×300
  • companycover: 1536×768
  • companysponsoredcontent: 1200×627
  • companyhero: 1128×376
  • companybanner: 646×220
YouTube

Default value is set to : channelcoverdesktop

  • channelcoverdesktop: 2560×1440
  • channelcoverphone: 1546×423
  • displayad: 300×250
  • overlayad: 480×60
  • companion: 300×250
Pinterest

Default value is set to : profile

  • profile: 165×165
  • board: 222×150
  • pin: 1000×1500
Tumblr

Default value is set to : profile

  • profile: 128×128
  • post: 500×750

Upload/Post Example
$ curl --location --request POST \
  -i 'https://api.apilayer.com/social_asset/instagram/upload' \
  --data-binary '@/path/to/file/image.jpg' \
  --header 'Content-Type: octet/stream' \
  --header 'apikey: YOUR API KEY'

Response:

HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 146
:
:
{
    "orientation": "square",
    "service": "instagram",
    "width": 1080,
    "height": 1080,
    "url": "https://assets.apilayer.com/social_asset/instagram-square-1080x1080.jpg"
}
URL/Get Example
$ curl --location --request GET \
  -i 'https://api.apilayer.com/social_asset/tumblr/url?url=https%3A%2F%2Fexample.com%2Fimages%2Ftest.jpg%26orientation%3Dpost' \
  --header 'Content-Type: octet/stream' \
  --header 'apikey: YOUR API KEY'

Response:

HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 146
:
:
{
    "orientation": "post",
    "service": "tumblr",
    "width": 1080,
    "height": 1080,
    "url": "https://assets.apilayer.com/social_asset/tumblr-post-500x750-1f1299c0-e9b2-11ea-9741-acde48001122.jpg"
}