imgurwrap
Description
Imgurwrap is a node.js module for making requests against the Imgur API.
Supports querying the API for image and album data by ID or URL.
How to use
Start by requiring the module
imgurwrap = ;
Basic configuration
- Register with Imgur to get a ClientID for your application.
imgurwrap; // Replace with your UserAgentimgurwrap; // Replace with your CleintID
Data models returned by the API
1. Request an image by ID
imgurwrap;
2. Request an album by ID
imgurwrap;
3. Request an image, multiple images, or an album by URL
The returned model property will be either 'image', 'images', or 'album'
imgurwrap; imgurwrap; imgurwrap;
4. Upload an image
From another URL:
imgurwrap;
From a file:
var imageData = fs; imgurwrap;
From a Base64 encoded file:
var imageData = fs; imgurwrap;
5. Delete an image
imgurwrap;
6. Request rate limiting information
imgurwrap;
For commercial usage, Mashape can be utilized for making requests.
- Register with Mashape to get a MashapeAuthID for your application.
// Replace with your MashapeAuthIDimgurwrap;
Note that on setting the MashapeAuthID, the endpoint used for making requests will automaticaly be updated to point to the Mashape Imgur endpoint (i.e. https://imgur-apiv3.p.mashape.com/).
Available configuration options
- Register with Imgur to get a ClientID for your application.
- Register with Mashape to get a MashapeAuthID for your application.
// Replace with your CleintIDimgurwrap; // Replace with your MashapeAuthIDimgurwrap; imgurwrap;imgurwrap;imgurwrap;