> For the complete documentation index, see [llms.txt](https://developers.oxylabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.oxylabs.io/products/web-scraper-api/features/result-processing-and-storage/output-types/download-images.md).

# Download Images

You can download images in jpeg, svg, and png formats using the Web Scraper API.

If you do that through [**Proxy Endpoint**](/products/web-scraper-api/integration-methods/proxy-endpoint.md), you can simply save the output to image extension, for example:

{% code overflow="wrap" %}

```shell
curl -k -x realtime.oxylabs.io:60000 -U "USERNAME:PASSWORD" "https://sandbox.oxylabs.io/assets/action-adventure.svg" > image.svg
```

{% endcode %}

If you are using the [**Push-Pull**](/products/web-scraper-api/integration-methods/push-pull.md) or [**Realtime**](/products/web-scraper-api/integration-methods/realtime.md) integration methods, you will need to add the `content_encoding` parameter with a value of `base64`. Once you receive the results, you need to decode encoded data from `content` into bytes and save it as an image file.

Please find an example in Python below.

```python
import base64
import json
import requests

# Your credentials.
USERNAME = ''
PASSWORD = ''

# Image URL which will be saved to file.
URL_IMAGE = 'https://sandbox.oxylabs.io/assets/action-adventure.svg'

# Realtime URL.
API_URL = f'https://{USERNAME}:{PASSWORD}@realtime.oxylabs.io/v1/queries'


def dump_to_file(filename: str, data: bytes):
    with open(filename, 'wb') as file:
        file.write(data)


def main():
    parameters = {
        'source': 'universal',
        'url': URL_IMAGE,
        'content_encoding': 'base64',
    }
    response = requests.post(API_URL, json=parameters)
    if response.ok:
        data = json.loads(response.text)
        content_base64 = data['results'][0]['content']
        # Decode base64 encoded data into bytes.
        content = base64.b64decode(content_base64)
        dump_to_file('out.svg', content)


if __name__ == '__main__':
    main()
```


---

# 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://developers.oxylabs.io/products/web-scraper-api/features/result-processing-and-storage/output-types/download-images.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.
