Account
Current Account
To make requests for the current account, you may use {username: 'me'}
. For example,
imgur.account.images({username:'me', access_token: 'myaccesstoken'})
will request all the images for the account that is currently authenticated.
Account Base
Request standard user information. If you need the username for the account that is logged in, it is returned in the request for an access token.
Parameters
username |
required |
username of the account |
Account Gallery Favorites
Return the images the user has favorited in the gallery.
Parameters
username |
required |
username of the account |
page |
optional |
integer - allows you to set the page number so you don't have to retrieve all the data at once. |
Account Favorites
Returns the users favorited images, only accessible if you're logged in as the user.
Method |
imgur.account.favorites() |
Gallery Image OR Gallery Album, Note: vote data ('ups', 'downs', and 'score') may be null if the favorited item hasn't been submitted to gallery |
Parameters
username |
required |
username of the account |
Account Submissions
Return the images a user has submitted to the gallery
Parameters
username |
required |
username of the account |
page |
optional |
integer - allows you to set the page number so you don't have to retrieve all the data at once. |
Account Settings
Returns the account settings, only accessible if you're logged in as the user.
Parameters
username |
required |
username of the account |
Change Account Settings
Updates the account settings for a given user, the user must be logged in.
imgur.account.changeSettings() |
Basic |
Parameters
username |
required |
username of the account |
data |
required |
bio |
optional |
The biography of the user, is displayed in the gallery profile page. |
public_images |
optional |
Set the users images to private or public by default |
messaging_enabled |
optional |
true | false - Allows the user to enable / disable private messages |
album_privacy |
optional |
public | hidden | secret - Sets the default privacy level of albums the users creates |
accepted_gallery_terms |
optional |
true | false - The user agreement to the Imgur Gallery terms. |
username |
optional |
A valid Imgur username (between 4 and 63 alphanumeric characters) |
|
Account Gallery Profile
Returns the totals for the gallery profile.
Parameters
username |
required |
username of the account |
Verify User's E-mail
Checks to see if user has verified their email address
Method |
imgur.account.verifyEmail() |
Basic |
Parameters
username |
required |
username of the account |
Send Verification E-mail
Sends an email to the user to verify that their email is valid to upload to gallery. Must be logged in as the user to send.
Method |
imgur.account.sendVerificationEmail() |
Basic |
Parameters
username |
required |
username of the account |
Albums
Get all the albums associated with the account. Must be logged in as the user to see secret and hidden albums.
Method |
imgur.account.albums() |
Album |
Parameters
username |
required |
username of the account |
page |
optional |
integer - allows you to set the page number so you don't have to retrieve all the data at once. |
Album
Get additional information about an album, this endpoint works the same as the Album Endpoint. You can also use any of the additional routes that are used on an album in the album endpoint.
Method |
imgur.account.album() |
Album |
Parameters
username |
required |
username of the account |
id |
required |
id of the album |
Album IDs
Return an array of all of the album IDs.
Method |
imgur.account.albumIds() |
Basic |
Parameters
username |
required |
username of the account |
page |
optional |
integer - allows you to set the page number so you don't have to retrieve all the data at once. |
Album Count
Return the total number of albums associated with the account.
Method |
imgur.account.albumCount() |
Basic |
Parameters
username |
required |
username of the account |
Album Deletion
Delete an Album with a given id.
Method |
imgur.account.deleteAlbum() |
Basic |
Parameters
username |
required |
username of the account |
id |
required |
id of the album |
Comments
Return the comments the user has created.
Method |
imgur.account.comments() |
Comment |
Parameters
username |
required |
username of the account |
page |
optional |
integer - allows you to set the page number so you don't have to retrieve all the data at once. |
sort |
optional |
'oldest', or 'newest'. Defaults to 'newest'. |
Comment
Return information about a specific comment. This endpoint works the same as the Comment Endpoint. You can use any of the additional actions that the comment endpoint allows on this end point.
Method |
imgur.account.comment() |
Comment |
Parameters
username |
required |
username of the account |
id |
required |
id of the comment |
Comment IDs
Return an array of all of the comment IDs.
Method |
imgur.account.commentIds() |
Basic |
Parameters
username |
required |
username of the account |
page |
optional |
integer - allows you to set the page number so you don't have to retrieve all the data at once. |
sort |
optional |
'oldest', or 'newest'. Defaults to 'newest'. |
Comment Count
Return a count of all of the comments associated with the account.
Method |
imgur.account.commentCount() |
Basic |
Parameters
username |
required |
username of the account |
Comment Deletion
Delete a comment. You are required to be logged in as the user whom created the comment.
Method |
imgur.account.deleteComment() |
Basic |
Parameters
username |
required |
username of the account |
id |
required |
id of the comment |
Images
Return all of the images associated with the account. You can page through the images by setting the page, this defaults to 0.
Method |
imgur.account.images() |
Image |
Parameters
username |
required |
username of the account |
page |
optional |
integer - allows you to set the page number so you don't have to retrieve all the data at once. |
Image
Return information about a specific image. This endpoint works the same as the Image Endpoint. You can use any of the additional actions that the image endpoint with this endpoint.
Method |
imgur.account.image() |
Image |
Parameters
username |
required |
username of the account |
id |
required |
id of the image |
Image IDs
Returns an array of Image IDs that are associated with the account.
Method |
imgur.account.imageIds |
Basic |
Parameters
username |
required |
username of the account |
page |
optional |
integer - allows you to set the page number so you don't have to retrieve all the data at once. |
Image Count
Returns the total number of images associated with the account.
Method |
imgur.account.imageCount() |
Basic |
Parameters
username |
required |
username of the account |
Image Deletion
Deletes an Image. This requires a delete hash rather than an ID.
Method |
imgur.account.deleteImage() |
Basic |
Parameters
username |
required |
username of the account |
deletehash |
required |
delete hash of the image |
Replies
Returns all of the reply notifications for the user. Required to be logged in as that user
Parameters
username |
required |
username of the account |
newReplies |
optional |
boolean - false for all notifications, true for only non-viewed notification. Default is true. |
Album
Additional Information
Everywhere you see ids[]
, you need to pass the data as an array {ids: [1,2]}
.
Album
Get information about a specific album.
Method |
imgur.album.album() |
Album |
Parameters
id |
required |
id of the album |
Album Images
Return all of the images in the album
Method |
imgur.album.images() |
Image |
Parameters
id |
required |
id of the album |
Album Image
Get information about an image in an album, any additional actions found in Image
Endpoint will also work.
Method |
imgur.album.image() |
Image |
Parameters
album_id |
required |
id of the album |
image_id |
required |
id of the image |
Album Creation
Create a new album. Optional parameter of ids[] is an array of image ids to add to the album.
This method is available without authenticating an account, and may be used merely by sending "Authorization: Client-ID {client_id}" in the request headers. Doing so will create an anonymous album which is not tied to an account.
Method |
imgur.album.create() |
Basic |
Parameters
data |
required |
ids[] |
optional |
The image ids that you want to be included in the album. |
title |
optional |
The title of the album |
description |
optional |
The description of the album |
privacy |
optional |
Sets the privacy level of the album. Values are : public | hidden | secret |
layout |
optional |
Sets the layout to display the album. Values are : blog | grid | horizontal | vertical |
cover |
optional |
The ID of an image that you want to be the cover of the album |
|
Update Album
Update the information of an album. For anonymous albums, {album} should be the deletehash that is returned at creation.
Method |
imgur.album.update() |
Basic |
Parameters
id |
required |
id of the album |
data |
required |
ids[] |
optional |
The image ids that you want to be included in the album. |
title |
optional |
The title of the album |
description |
optional |
The description of the album |
privacy |
optional |
Sets the privacy level of the album. Values are : public | hidden | secret |
layout |
optional |
Sets the layout to display the album. Values are : blog | grid | horizontal | vertical |
cover |
optional |
The ID of an image that you want to be the cover of the album |
|
Album Deletion
Delete an album with a given ID. You are required to be logged in as the user to delete the album. For anonymous albums, {album} should be the deletehash that is returned at creation.
Method |
imgur.album.delete() |
Basic |
Parameters
id |
required |
id of the album |
Favorite Album
Favorite an album with a given ID. The user is required to be logged in to favorite the album.
Method |
imgur.album.favorite() |
Basic |
Parameters
id |
required |
id of the album |
Set Album Images
Sets the images for an album, removes all other images and only uses the images in this request. For anonymous albums, album_id
should be the deletehash that is returned at creation.
Method |
imgur.album.setImages() |
Basic |
Parameters
album_id |
required |
id of the album |
image_ids[] |
required |
The image ids that you want to be added to the album. |
Add Images to an Album
Takes parameter, ids[], as an array of ids to add to the album. Alternatively, the ids parameter can take a comma delimted string of ids. See below for examples. For anonymous albums, album_id
should be the deletehash that is returned at creation.
Method |
imgur.album.addImages() |
Basic |
Parameters
album_id |
required |
id of the album |
image_ids[] |
required |
The image ids that you want to be added to the album. |
Remove Images from an Album
Takes parameter, ids[], as an array of ids and removes from the album. For anonymous albums, {album} should be the deletehash that is returned at creation.
Method |
imgur.album.deleteImages() |
Basic |
Parameters
album_id |
required |
id of the album |
image_ids[] |
required |
The image ids that you want to be added to the album. |
Conversation
Conversation List
Get list of all conversations for the logged in user.
Method |
imgur.conversation.conversations() |
Array of Conversation |
Conversation
Get information about a specific conversation. Includes messages.
Parameters
id |
required |
id of the conversation |
page |
optional |
Page of message thread. Starting at 1 for the most recent 25 messages and counting upwards. Defaults to 1 |
offset |
optional |
Additional offset in current page, defaults to 0. |
Message Creation
Create a new message.
Method |
imgur.conversation.createMessage() |
Basic |
Parameters
recipient |
required |
The recipient username, this person will receive the message |
body |
required |
The message itself, similar to the body of an email. |
Conversation Deletion
Delete a conversation by the given ID.
Method |
imgur.conversation.delete() |
Basic |
Parameters
id |
required |
id of the conversation |
Report Sender
Report a user for sending messages that are against the Terms of Service.
Method |
imgur.conversation.reportSender() |
Basic |
Parameters
username |
required |
username of the account |
Block Sender
Block the user from sending messages to the user that is logged in.
Method |
imgur.conversation.blockSender() |
Basic |
Parameters
username |
required |
username of the account |
Gallery
Custom Gallery
View images for current user's custom gallery
Parameters
sort |
optional |
viral | time | top - defaults to viral |
page |
optional |
integer - the data paging number |
window |
optional |
Change the date range of the request if the sort is "top", day | week | month | year | all, defaults to week |
Filtered Out Gallery
Retrieve user's filtered out gallery
Parameters
sort |
optional |
viral | time | top - defaults to viral |
page |
optional |
integer - the data paging number |
window |
optional |
Change the date range of the request if the sort is "top", day | week | month | year | all, defaults to week |
Custom Gallery Image
View a single image in a user's custom gallery
Parameters
id |
required |
The ID for the gallery item. |
Custom Gallery Add Tags
Add tags to a user's custom gallery
Method |
imgur.customGallery.addTags() |
Basic |
Parameters
tags[] |
required |
Array of tags (e.g. 'cats,dogs') |
Custom Gallery Remove Tags
Remove tags from a custom gallery
Method |
imgur.customGallery.removeTags() |
Basic |
Parameters
tags[] |
required |
Array of tags (e.g. 'cats,dogs') |
Filtered Out Gallery Add
Filter out a tag
Method |
imgur.customGallery.filteredBlockTag() |
Basic |
Parameters
tag |
required |
Name of the tag to block. |
Filtered Out Gallery Remove
Remove a filtered out tag
Method |
imgur.customGallery.filteredUnblockTag() |
Basic |
Parameters
tag |
required |
Name of the tag to unblock. |
Gallery
Due to caching limitations of Imgur, it's not possible to change the result size of the gallery resources.
Gallery
Returns the images in the gallery. For example the main gallery is https://api.imgur.com/3/gallery/hot/viral/0.json
Parameters
section |
optional |
hot | top | user - defaults to hot |
sort |
optional |
viral | top | time | rising (only available with user section) - defaults to viral |
page |
optional |
integer - the data paging number |
window |
optional |
Change the date range of the request if the section is "top", day | week | month | year | all, defaults to day |
showViral |
optional |
true | false - Show or hide viral images from the 'user' section. Defaults to true |
Memes Subgallery
View images for memes subgallery
Parameters
sort |
optional |
viral | time | top - defaults to viral |
page |
optional |
integer - the data paging number |
window |
optional |
Change the date range of the request if the sort is "top", day | week | month | year | all, defaults to week |
Memes Subgallery Image
View a single image in the memes gallery
Parameters
id |
required |
The ID for the image. |
Subreddit Galleries
View gallery images for a subreddit
Method |
imgur.gallery.subreddit() |
Gallery Images with 'reddit_comments' url |
Parameters
subreddit |
required |
pics - A valid subreddit name |
sort |
optional |
time | top - defaults to time |
page |
optional |
integer - the data paging number |
window |
optional |
Change the date range of the request if the sort is "top", day | week | month | year | all, defaults to week |
Subreddit Image
View a single image in the subreddit
Method |
imgur.gallery.subredditImage() |
Gallery Image with 'reddit_comments' url |
Parameters
subreddit |
required |
pics - A valid subreddit name |
image_id |
required |
The ID for the image. |
Gallery Tag
View images for a gallery tag
Method |
imgur.gallery.tag() |
Tag |
Parameters
t_name |
required |
The name of the tag. |
sort |
optional |
viral | time | top - defaults to viral |
page |
optional |
integer - the data paging number |
window |
optional |
Change the date range of the request if the sort is "top", day | week | month | year | all, defaults to week |
Gallery Tag Image
View a single image in a gallery tag
Parameters
t_name |
required |
The name of the tag. |
image_id |
required |
The ID for the image. |
Gallery Item Tags
View tags for a gallery item
Parameters
id |
required |
ID of the gallery item |
Gallery Tag Voting
Vote for a tag, 'up' or 'down' vote. Send the same value again to undo a vote.
Method |
imgur.gallery.tagVote() |
Basic |
Parameters
id |
required |
ID of the gallery item |
t_name |
required |
Name of the tag (implicitly created, if doesn't exist) |
vote |
required |
'up' or 'down' |
Gallery Search
Search the gallery with a given query string.
Parameters
sort |
optional |
time | viral | top - defaults to time |
window |
optional |
Change the date range of the request if the sort is 'top', day | week | month | year | all, defaults to all. |
page |
optional |
integer - the data paging number |
Simple Search Query Parameters
q |
Query string (note: if advanced search parameters are set, this query string is ignored). This parameter also supports boolean operators (AND, OR, NOT) and indices (tag: user: title: ext: subreddit: album: meme:). An example compound query would be 'title: cats AND dogs ext: gif' |
Advanced Search Query Parameters
q |
q_all |
Search for all of these words (and) |
q_any |
Search for any of these words (or) |
q_exactly |
Search for exactly this word or phrase |
q_not |
Exclude results matching this |
q_type |
Show results for any file type, jpg | png | gif | anigif (animated gif) | album |
q_size_px |
Size ranges, small (500 pixels square or less) | med (500 to 2,000 pixels square) | big (2,000 to 5,000 pixels square) | lrg (5,000 to 10,000 pixels square) | huge (10,000 square pixels and above) |
|
Random Gallery Images
Returns a random set of gallery images.
Parameters
page |
optional |
A page of random gallery images, from 0-50. Pages are regenerated every hour. |
Publish to Imgur
Share an Album or Image to the Gallery.
Method |
imgur.gallery.publish() |
Basic |
Parameters
id |
required |
id of album or image |
title |
required |
The title of the image. This is required. |
topic |
optional |
Topic name |
terms |
optional |
If the user has not accepted our terms yet, this endpoint will return an error. To by-pass the terms in general simply set this value to 1. |
Remove from Gallery
Remove an image from the gallery. You must be logged in as the owner of the item to do this action.
Method |
imgur.gallery.delete() |
Basic |
Parameters
id |
required |
id of album or image |
Album
Get additional information about an album in the gallery.
Parameters
Image
Get additional information about an image in the gallery.
Parameters
Album / Image Reporting
Report an Image in the gallery
imgur.gallery.report() |
Basic |
Parameters
id |
required |
id of album or image |
Album / Image Votes
Get the vote information about an image
Method |
imgur.gallery.votes() |
Vote |
Parameters
id |
required |
id of album or image |
Album / Image Voting
Vote for an image, 'up' or 'down' vote. Send the same value again to undo a vote.
Method |
imgur.gallery.vote() |
Basic |
Parameters
id |
required |
id of album or image |
vote |
required |
"up" or "down" |
Album / Image Comments
Comment on an image in the gallery.
Method |
imgur.gallery.comments() |
Comment |
Parameters
id |
required |
id of album or image |
sort |
optional |
best | top | new - defaults to best |
Album / Image Comment
Information about a specific comment. This action also allows any of the additional actions provided in the Comment Endpoint.
Method |
imgur.gallery.comment() |
Comment |
Parameters
id |
required |
id of the album or image |
comment_id |
required |
id of the comment |
Album / Image Comment Creation
Create a comment for an image.
Method |
imgur.gallery.createComment() |
Basic |
Parameters
id |
required |
id of the album or image |
comment |
required |
The text of the comment. |
Album / Image Comment Reply Creation
Reply to a comment that has been created for an image.
Method |
imgur.gallery.createCommentReply() |
Basic |
Parameters
Parameters
id |
required |
id of album or image |
comment_id |
required |
id of the comment |
comment |
required |
The text you want to use as the reply. |
Album / Image Comment IDs
List all of the IDs for the comments on an image.
Method |
imgur.gallery.commentIds() |
Basic |
Parameters
id |
required |
id of album or image |
Album / Image Comment Count
The number of comments on an Image.
Method |
imgur.gallery.commentCount() |
Basic |
Parameters
sort |
optional |
best | top | new - defaults to best |
Image
Image
Get information about an image.
Method |
imgur.image.image() |
Image |
Parameters
id |
required |
id of the image |
Image Upload
Upload a new image.
Method |
imgur.image.upload() |
Basic |
Parameters
file |
required |
A binary file, base64 data, or a URL for an image. (up to 10MB) EG:imgur.image.upload({file: fs.createReadStream('myImage.png')}) |
album |
optional |
The id of the album you want to add the image to. For anonymous albums, {album} should be the deletehash that is returned at creation.
|
type |
optional |
The type of the file that's being sent; file, base64 or URL |
name |
optional |
The name of the file, this is automatically detected if uploading a file with a POST and multipart / form-data |
title |
optional |
The title of the image. |
description |
optional |
The description of the image. |
Image Deletion
Deletes an image. For an anonymous image, id
must be the image's deletehash. If the image belongs to your account then passing the ID of the image is sufficient.
Method |
imgur.image.delete() |
Basic |
Parameters
id |
required |
id of the image |
Update Image Information
Updates the title or description of an image. You can only update an image you own and is associated with your account. For an anonymous image, {id} must be the image's deletehash.
Method |
imgur.image.update() |
Basic |
Parameters
id |
required |
id of the image |
data |
required |
title |
optional |
The title of the image. |
description |
optional |
The description of the image. |
|
Favorite an Image
Favorite an image with the given ID. The user is required to be logged in to favorite the image.
Method |
imgur.image.favorite() |
Basic |
Parameters
id |
required |
id of the image |
Oauth
OAuth URL
Returns the URL for the user to visit to authenticate.
Method |
imgur.oauth.getOauthUrl() |
Authorize Callback
Returned to your application via the redirect URL you specified during registration, in the form of a regular query string parameter. (Keep in mind that you can use localhost as a redirect URL.) For example: http://example.com?code=AUTHORIZATION_CODE After you have the authorization_code, it must be exchanged for an access_token and refresh_token.
Method |
imgur.oauth.authorizeCallback() |
Parameters
Refresh Token
If a user has authorized their account but you no longer have a valid access_token for them, then a new one can be generated by using the refresh_token. When your application receives a refresh token, it is important to store that refresh token for future use. If your application loses the refresh token, you will have to prompt the user for their login information again.
Method |
imgur.oauth.refreshToken() |
Parameters
Comment Creation
Creates a new comment, returns the ID of the comment.
imgur.comment.create()
Parameters