> For the complete documentation index, see [llms.txt](https://help.pixboost.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.pixboost.com/api.md).

# API. URL-based integration

To make integration easier we provide a lightweight API that you can directly use from HTML code.

## URL pattern for API call

All endpoints follow the same pattern

`https://pixboost.com/api/2/img/[IMAGE_URL|IMAGES_SOURCE_ALIAS_WITH_PATH]/[OPERATION]?[OPERATION_PARAMS]&auth=[API_KEY]`

| Item                                     | Description                                                               |
| ---------------------------------------- | ------------------------------------------------------------------------- |
| **\[IMAGE\_URL]**                        | The URL of the original image you would like to process through Pixboost. |
| **\[IMAGES\_SOURCE\_ALIAS\_WITH\_PATH]** | An alias of an images source with relative path to the image.             |
| **\[OPERATION]**                         | Pixboost function call                                                    |
| **\[OPERATION\_PARAMS]**                 | Operation parameters for a function call you are using                    |
| **\[API\_KEY]**                          | A unique [API key](/setup/manage-api-keys.md)                             |

### Example using **\<img>** tag

Before:

`<img src="http://www.midday.coffee/assets/cup.jpeg" alt="Midday Coffee">`

After:

`<img src="http://pixboost.com/api/2/img/http://www.midday.coffee/assets/cup.jpeg/resize?size=200x100&auth=MTg4MjMxMzM3MA__" alt="Midday Coffee">`

### Example using **\<picture>** tag

Before:

```markup
<picture>
    <source srcset="http://www.midday.coffee/assets/cup.jpeg" 
        media="(min-width: 769px)">
    <source srcset="http://www.midday.coffee/assets/cup.jpeg" 
        media="(max-width: 768px)">
    <source srcset="http://www.midday.coffee/assets/cup.jpeg" 
        media="(max-width: 576px)">
    <img src="http://www.midday.coffee/assets/cup.jpeg">
</picture>
```

After:

```markup
<picture>
    <source srcset="https://pixboost.com/api/2/img/http://www.midday.coffee/assets/cup.jpeg/optimise?auth=API_KEY" 
        media="(min-width: 769px)">
    <source srcset="https://pixboost.com/api/2/img/http://www.midday.coffee/assets/cup.jpeg/resize?size=300&auth=API_KEY" 
        media="(max-width: 768px)">
    <source srcset="https://pixboost.com/api/2/img/http://www.midday.coffee/assets/cup.jpeg/fit?size=100x100&auth=API_KEY" 
        media="(max-width: 576px)">
    <img src="http://www.midday.coffee/assets/cup.jpeg">
</picture>
```

We support all transformation required for the typical website.

![](/files/-Lmt8zRYV7T0MqqVegRb)

Read more on operations:

## [Resize](/api/resize.md)

## [Fit](/api/fit.md)

## [Optimise](/api/optimise.md)

## [As is](/api/as-is.md)

You can explore API sandbox here: <https://pixboost.com/docs/api/>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.pixboost.com/api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
