> ## 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 Infrared Image

> Retrieve a specific infrared image by its ID

## Overview

This endpoint allows you to retrieve a specific infrared 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 infrared image:

```python theme={null}
import requests

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

### Download Image File

Download the actual infrared image file:

```python theme={null}
import requests

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

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

### Batch Download Example

Download multiple infrared 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/infrared/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/infrared/r/{image['image_id']}",
        params={"download": True}
    )

    with open(f"infrared_{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/infrared/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/infrared/r/{image_id}:
    get:
      tags:
        - Infrared Imagery
      summary: Get infrared image by ID
      description: Retrieve a specific infrared 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: Not Found - The requested URL was not found on the server
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Error message
                  status:
                    type: integer
                    description: HTTP status code
                  title:
                    type: string
                    description: Error title
                  type:
                    type: string
                    description: Error type
              example:
                detail: >-
                  The requested URL was not found on the server. If you entered
                  the URL manually please check your spelling and try again.
                status: 404
                title: Not Found
                type: about:blank
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

````