TwicPics is powered by an URL-based API that can be used to transform and manipulate images.
The TwicPics API is URL-based and every URL is structured as follows:
<manipulation>is a list of one or more transformations separated by the character
<authentication>is an identifier that allows the use of any source image regardless of its domain (see the documentation about authentication for more information)
<source image>is the URL of the image to manipulate (both
https:are supported) or a placeholder expression.
Here are three basic examples:
http://mydomain.com/myimage.pngto a width of 450 pixels while preserving its aspect ratio
https://mydomain.com/myimage.pngto a width of 300 pixels while preserving its aspect ratio, on behalf of the client identified by the authentication identifier
https://i.twic.pics/v1/resize=640x480/placeholder:autowill generate a 640 pixels wide per 480 pixels high gray colored placeholder.
Whenever something goes wrong, TwicPics will issue an HTTP error with a sensible status code and a short explanation in plain text as a body.
TwicPics will error when:
GETrequest to retrieve it resulted in an HTTP error)
Whenever an image does not show in your web page, be sure to check the network tab of your favorite dev tool for those red-colored lines indicative of a network error.