Quickstart
This guide will get you all set up and ready to use the Resizely API. We'll cover how to get started using our API endpoint and how to make your first API request. We'll also look at where to go next to find all the information you need to take full advantage of our powerful REST API.
Before you can make requests to the Resizely API, you will need to grab your API key from your dashboard. You find it under Dashboard » Api key.
Making your first API request
After picking your Api key, you are ready to make your first call to the Resizely API. Below, you can see how to send a GET request to the Resizely endpoint to get a resized image.
Suppose we need a resized version of an image, whose url is https://storage.googleapis.com/static.resizely.net/samples/sample_1.jpg
We then can have a resized version of the image in two ways.
Using key value pairs
With this way we will need to construct a url like this: https://api.resizely.net/API_KEY/EDITS/URL_OF_THE_IMAGE
where:
- API_KEY is the api key you can retrieve in the Resizely dashboard.
- EDITS are the manipulation you want to apply to image. They are key value pairs separated by colon. eg
w=960:crop=true:out=webp
- URL_OF_THE_IMAGE is the public url of the image
Edit | Param | Type | Default value |
---|---|---|---|
Width | w | numeric | 0 |
Height | h | numeric | 0 |
Crop | crop | boolean | false |
Output | out | 'jpg', 'png', 'webp' | The same of input image |
crop=true
. Otherwise a fit rule will be applied.curl -G https://api.resizely.net/[API_KEY]/w=960:h=960:crop=true:out=webp/https://storage.googleapis.com/static.resizely.net/samples/sample_1.jpg
Using base64
Or else you can encode a json object in base 64. This is useful when you work with long urls and you could have final urls longer than 2048 characters.
{
"key": API_KEY,
"url": URL_OF_THE_IMAGE,
"edits": {
"resize": {
"width": WIDTH,
"height": HEIGHT,
},
"crop": true
}
}
where:
- API_KEY is the api key you can retrieve in the Resizely dashboard.
- URL_OF_THE_IMAGE is the public url of the image
- WIDTH and HEIGHT are the final sizes of the image you need
- CROP if you wish to apply a "contain" rule, or false if you wish to apply a "cover" rule
curl -G https://api.resizely.net/[API_KEY]/[BASE_64_ENCODE]
What's next?
Great, you're now set up with an API client and have made your first request to the API. Here are a few links that might be handy as you venture further into the Resizely API: