Image generator for social networks such as;
- YouTube
- 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
Default value is set to : square
square
: 1080×1080landscape
: 1080×566portrait
: 1080×1350profile
: 110×110story
: 1080×1920
Default value is set to : profile
profile
: 400×400header
: 1500×500image
: 1024×512card
: 1200×628ad
: 800×428
Default value is set to : profile
profile
: 180×180cover
: 820×462link
: 1200×630image
: 1200×630event
: 1920×1080ad
: 1200×628storyad
: 1080×1920groupcover
: 1640×922messengerad
: 1200×628
Default value is set to : profile
profile
: 400×400background
: 1584×396postdesktop
: 1200×1200postmobile
: 1200×628post
: 1200×628companylogo
: 300×300companycover
: 1536×768companysponsoredcontent
: 1200×627companyhero
: 1128×376companybanner
: 646×220
YouTube
Default value is set to : channelcoverdesktop
channelcoverdesktop
: 2560×1440channelcoverphone
: 1546×423displayad
: 300×250overlayad
: 480×60companion
: 300×250
Default value is set to : profile
profile
: 165×165board
: 222×150pin
: 1000×1500
Tumblr
Default value is set to : profile
profile
: 128×128post
: 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" }