Upload to an image to imgur from the command line with curl

First, go to https://api.imgur.com/oauth2/addclient and register as a client. Create a new client and you'll eventually get a Client ID and a Client secret.

Now take the client ID, and use this curl command:

curl --request POST --url https://api.imgur.com/3/image --header 'authorization: Client-ID YOUR_CLIENTID_HERE'   
--header 'content-type: multipart/form-data;' -F "image=@/LOCATION/OF/THE/IMAGE.png"

You should get some JSON back like this:

unix imgur unix-curl

Edit on github
comments powered by Disqus
Click me