POST
endpoint.👆
to
👉
Pay as you go
$0.01 per unique image. That's it.
You only pay for the first API request for any unique image. After that, the same image and request is free.
Adding credits is required (minimum $1) when your free credits run out. An "auto top-up" option is available when you run low.
$0.01 = 1 credit
The point is to NOT make a network request when serving these kind of placeholder images (that defeats the point of them). SolidImage is also not meant to be used as a "image proxy service", which sometimes offer blur support, but they are usually meant as an on-demand image manipulation service. Example of those would be something like https://imageproxy.com?img=mydomain.com/images/test.jpg&q=40&blur=4&w=100.
The image will be rendered like this instantly without a network request, and later the full image loads in.
* fading in an image, and stacking them on top of each other, is up to you to implement.
cURL example
curl --location 'https://solidimage.dev/api/v1/image_analysis' \ --form 'analysis[file]=@"test.jpg"' \ --form 'api_key="eyJfcmFpbHMiOnsiZGF1YSI0WzJdLCKwdXIiOiJBcHBcbmFwaV9rZXicbiJ9fO==--fc382c5c9f03f61n9b02d5bb2d7927611ac9ee49"' \ --form 'analysis[thumb_hash_data_url_enabled]="1"'
API response example (200 OK)
{ "result": { "thumb": { "dataUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhE … Sx3AAAAAABJRU5ErkJggg==", "dimensions": { "width": 100, "height": 75, "aspectRatio": 1.333 } } }, "meta": { "creditsCost": 1.0, "originalCreditsCost": null, "imageFileName": "test.jpg", "remainingCredits": 9.0 }, "errorCode": null, "errorMessage": null, "success": true, "statusCode": "ok", "status": 200 }
HTML (JSX) example
<img src={response.result.thumb.dataUrl} width={200} height={200 / response.result.thumb.dimensions.aspectRatio} />