> ## Documentation Index
> Fetch the complete documentation index at: https://docs.avert.ldeo.columbia.edu/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Visible Image

> Retrieve a specific visible image by its ID

## Overview

This endpoint allows you to retrieve a specific visible image using its unique identifier. You can either get the image metadata or download the actual image file.

## Usage Examples

### Get Image Metadata

Retrieve metadata for a specific visible image:

```python theme={null}
import requests

response = requests.get(
    f"https://avert-legacy.ldeo.columbia.edu/api/imagery/visible/r/{image_id}"
)
image_info = response.json()
```

### Download Image File

Download the actual visible image file:

```python theme={null}
import requests

response = requests.get(
    f"https://avert-legacy.ldeo.columbia.edu/api/imagery/visible/r/{image_id}",
    params={"download": True}
)

# Save the image file
with open(f"visible_image_{image_id}.jpg", "wb") as f:
    f.write(response.content)
```

### Batch Download Example

Download multiple visible images from a query result:

```python theme={null}
import requests

# First, get the list of images
query_response = requests.get(
    "https://avert-legacy.ldeo.columbia.edu/api/imagery/visible/query",
    params={
        "site": "CLNE",
        "vnum": 311240,
        "search_from": "2022-10-01T00:00",
        "search_to": "2022-10-02T00:00"
    }
)

# Then download each image individually
for image in query_response.json():
    print(f"Downloading image: {image['image_id']}")
    image_response = requests.get(
        f"https://avert-legacy.ldeo.columbia.edu/api/imagery/visible/r/{image['image_id']}",
        params={"download": True}
    )

    with open(f"visible_{image['image_id']}.jpg", "wb") as f:
        f.write(image_response.content)
```

## Notes

* Image IDs are obtained from the query endpoint response
* When `download=false` (default), you get JSON metadata about the image
* When `download=true`, you get the binary image file
* Image file formats vary (JPEG, PNG, etc.) - check the `file_format` field in metadata


## OpenAPI

````yaml GET /imagery/visible/r/{image_id}
openapi: 3.1.0
info:
  title: AVERT Imagery API
  description: >-
    API for accessing infrared and visible imagery data from AVERT volcanic
    monitoring systems
  license:
    name: MIT
  version: 0.0.2
servers:
  - url: https://avert-legacy.ldeo.columbia.edu/api
    description: AVERT Production API
security: []
paths:
  /imagery/visible/r/{image_id}:
    get:
      tags:
        - Visible Imagery
      summary: Get visible image by ID
      description: Retrieve a specific visible image by its ID
      parameters:
        - name: image_id
          in: path
          required: true
          description: Unique identifier for the image
          schema:
            type: string
        - name: download
          in: query
          required: false
          description: Download the image file
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Image file or metadata
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageResult'
            image/*:
              schema:
                type: string
                format: binary
        '404':
          description: Image not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ImageResult:
      type: object
      required:
        - id
        - image_id
        - site
        - vnum
        - timestamp
        - file_format
        - url
      properties:
        id:
          type: integer
          description: Database ID of the image record
          example: 269011
        image_id:
          type: string
          description: Unique identifier for the image file
          example: 311240.CLNE.2024.152_000001-0000
        site:
          type: string
          description: Site identifier
          example: CLNE
        vnum:
          type: integer
          description: Volcano number identifier
          example: 311240
        timestamp:
          type: string
          format: date-time
          description: When the image was captured
          example: '2024-05-31T00:00:01'
        file_format:
          type: string
          description: Image file format
          example: jpg
        url:
          type: string
          description: Relative path to the image file
          example: >-
            /data/vulcand/archive/imagery/visible/311240/2024/CLNE/still/152/311240.CLNE.2024.152_000001-0000.jpg
        frame:
          type: integer
          description: Frame number for video sequences
          example: 0
        quality:
          type: integer
          description: Image quality indicator
          example: 0
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: integer
          format: int32
          description: Error code
        message:
          type: string
          description: Error message

````