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
: 1080x1080landscape
: 1080x566portrait
: 1080x1350profile
: 110x110story
: 1080x1920
Default value is set to : profile
profile
: 400x400header
: 1500x500image
: 1024x512card
: 1200x628ad
: 800x428
Default value is set to : profile
profile
: 180x180cover
: 820x462link
: 1200x630image
: 1200x630event
: 1920x1080ad
: 1200x628storyad
: 1080x1920groupcover
: 1640x922messengerad
: 1200x628
Default value is set to : profile
profile
: 400x400background
: 1584x396postdesktop
: 1200x1200postmobile
: 1200x628post
: 1200x628companylogo
: 300x300companycover
: 1536x768companysponsoredcontent
: 1200x627companyhero
: 1128x376companybanner
: 646x220
YouTube
Default value is set to : channelcoverdesktop
channelcoverdesktop
: 2560x1440channelcoverphone
: 1546x423displayad
: 300x250overlayad
: 480x60companion
: 300x250
Default value is set to : profile
profile
: 165x165board
: 222x150pin
: 1000x1500
Tumblr
Default value is set to : profile
profile
: 128x128post
: 500x750
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" }