home / skills / vm0-ai / vm0-skills / imgur

imgur skill

/imgur

This skill uploads images to Imgur and returns public sharing URLs for embedding in articles or documentation.

npx playbooks add skill vm0-ai/vm0-skills --skill imgur

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
3.1 KB
---
name: imgur
description: Upload images to Imgur for free hosting. Use this skill when you need to upload images and get public URLs for sharing or embedding in articles.
vm0_secrets:
  - IMGUR_CLIENT_ID
---

# Imgur Image Hosting

Imgur is a free image hosting service. Upload images and get URLs for sharing, embedding in articles, or using in documentation.

## When to Use

- Upload images to get shareable URLs
- Host images for blog posts or documentation
- Get image URLs for use in Markdown content
- Anonymous image uploads (no account needed)

## Prerequisites

Set the following environment variable:

```bash
export IMGUR_CLIENT_ID=your_client_id
```

Get your Client ID from: https://api.imgur.com/oauth2/addclient

When registering:
- Authorization type: "OAuth 2 authorization without a callback URL"
- You only need the Client ID for anonymous uploads


> **Important:** When using `$VAR` in a command that pipes to another command, wrap the command containing `$VAR` in `bash -c '...'`. Due to a Claude Code bug, environment variables are silently cleared when pipes are used directly.
> ```bash
> bash -c 'curl -s "https://api.example.com" -H "Authorization: Bearer $API_KEY"'
> ```

## How to Use

### Upload Local Image

```bash
curl -X POST https://api.imgur.com/3/image -H "Authorization: Client-ID ${IMGUR_CLIENT_ID}" -F "image=@/path/to/image.png"
```

### Upload from URL

```bash
curl -X POST https://api.imgur.com/3/image -H "Authorization: Client-ID ${IMGUR_CLIENT_ID}" -F "image=https://example.com/image.png" -F "type=url"
```

### Upload Base64

```bash
curl -X POST https://api.imgur.com/3/image -H "Authorization: Client-ID ${IMGUR_CLIENT_ID}" -F "image=$(base64 -i /path/to/image.png)" -F "type=base64"
```

### Optional Parameters

| Parameter | Description |
|-----------|-------------|
| title | Image title |
| description | Image description |
| name | Filename |

```bash
curl -X POST https://api.imgur.com/3/image -H "Authorization: Client-ID ${IMGUR_CLIENT_ID}" -F "[email protected]" -F "title=My Screenshot" -F "description=Screenshot from my app"
```

## Response

```json
{
  "data": {
  "id": "abc123",
  "link": "https://i.imgur.com/abc123.png",
  "deletehash": "xyz789"
  },
  "success": true,
  "status": 200
}
```

Key fields:
- `data.link` - Public URL to use in Markdown: `![img](https://i.imgur.com/abc123.png)`
- `data.deletehash` - Save this to delete the image later

## Delete Image

Replace `<your-deletehash>` with the deletehash from the upload response:

```bash
curl -X DELETE https://api.imgur.com/3/image/<your-deletehash> -H "Authorization: Client-ID ${IMGUR_CLIENT_ID}"
```

## Rate Limits

- ~12,500 requests/day
- ~1,250 uploads/day (uploads cost 10 credits)
- Headers show remaining: `X-RateLimit-ClientRemaining`

## Guidelines

1. **Save deletehash**: Store it if you need to delete images later
2. **Anonymous uploads**: Images are not tied to any account
3. **Supported formats**: JPEG, PNG, GIF, APNG, TIFF, BMP, PDF, XCF, WebP
4. **Max file size**: 20MB for images, 200MB for GIFs

## API Reference

- Documentation: https://apidocs.imgur.com/
- Register App: https://api.imgur.com/oauth2/addclient

Overview

This skill uploads images to Imgur for free, anonymous hosting and returns public URLs suitable for sharing or embedding. It supports local files, remote URLs, and base64 payloads and provides delete hashes so uploads can be removed later. Set an IMGUR_CLIENT_ID environment variable before use.

How this skill works

The skill calls Imgur's anonymous image API using your Client ID in the Authorization header. It can POST a file, a remote URL, or base64-encoded image data and parses the JSON response to extract the public link and deletehash. It also supports deleting images by sending the deletehash to Imgur's DELETE endpoint.

When to use it

  • You need a quick public URL for an image without hosting infrastructure.
  • Embed images in documentation, blog posts, or Markdown content.
  • Share screenshots or assets when collaborating or filing issues.
  • Host images for demos, prototypes, or temporary use without an account.

Best practices

  • Set IMGUR_CLIENT_ID in your environment: export IMGUR_CLIENT_ID=your_client_id.
  • Wrap curl commands in bash -c '...' when piping to avoid environment variable loss in certain shells.
  • Store the returned data.deletehash if you may need to remove the image later.
  • Include title or description form fields when appropriate to aid management in Imgur.
  • Respect rate limits and monitor X-RateLimit-ClientRemaining header to avoid throttling.

Example use cases

  • Upload a local screenshot for a bug report and paste the returned link into an issue tracker.
  • Host images used inside a blog post or Markdown README by uploading and embedding the data.link URL.
  • Upload a remote image URL to create a stable Imgur-hosted copy for embedding.
  • Encode an image to base64 and upload when file transfer is constrained but inline data is available.
  • Delete a previously uploaded image using the saved deletehash when the asset is no longer needed.

FAQ

Do I need an Imgur account to upload?

No. Anonymous uploads are supported; you only need a Client ID from Imgur for the API.

How do I get a Client ID?

Register an app at https://api.imgur.com/oauth2/addclient and choose "OAuth 2 authorization without a callback URL" to obtain the Client ID.

What fields in the response are important?

Use data.link for the public URL and save data.deletehash if you may want to delete the image later.