HTTP Requests - Image Fetch

HTTP Requests / Image Fetch

POST https://api.optidash.ai/1.0/fetch
Description
The entire body of the request must consist of serialized JSON data.

Image Fetch uses the https://api.optidash.ai/1.0/fetch endpoint and allows you to provide a publicly available image URL for processing. That endpoint only accepts serialized JSON data with image processing steps along with a url property pointing to the image you want to process. Please be sure to set application/json as the Content-Type of your requests to the Image Fetch endpoint.

Requests fetching your images will come from the following IP address range: 212.224.84.128/26 and will have Optidash/1.0 User-Agent set in the headers.

If your assets are protected with HTTP Basic Auth, you may include a username and password as part of the image URL: https://user:[email protected]/image.jpg

An example cURL request to the Image Fetch endpoint would look like the following:

curl https://api.optidash.ai/1.0/fetch -X POST -u your-api-key: \
-H "Content-Type: application/json" \
-d '{
    "url": "https://www.website.com/image.jpg",
    "resize": {
        "width": 640,
        "height": 480
    }
}'

Custom Fetch Headers

If you wish to exercise greater control over the Fetch request by specifying custom request headers, this can be achieved by using the headers property within your JSON parameters. Any custom headers provided will be incorporated into the Fetch request made by the Optidash API to retrieve an image. For example:

curl https://api.optidash.ai/1.0/fetch -X POST -u your-api-key: \
-H "Content-Type: application/json" \
-d '{
    "url": "https://www.website.com/image.jpg",
    "headers": {
      "host": "example.com",
      "x-my-custom-header": "true"
    },
    "resize": {
        "width": 640,
        "height": 480
    }
}'