Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>Instagram Example</title>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="">
<link rel="stylesheet" href="">
<div class="content">
<h1>Instagram Example</h1>
Uploadcare allows Instagram users easily export their photos or videos and use
them somewhere else, e.g. import to 3rd party services like printing shops.
We use Uploadcare Widget to allow our users to upload Instagram photos from using accounts and our Instagram Basic Display API Application credentials.
<h2>How to review</h2>
<li>Click on the "Choose a file from Instagram" button.</li>
<li>Click on the "Connect to Instagram" button.</li>
<li>Allow an access to your photos.</li>
<li>Choose any photo or video.</li>
<li>When a photo or video is downloaded from Instagram,
we give the link to exported file in "Result" section.</li>
<input type="hidden" role="uploadcare-uploader" name="my_file" />
<span id="resultUrl">Choose image or video in the widget to see result URL</span><br>
<span id="resultPreview"></span>
UPLOADCARE_TABS = 'instagram_graph_api';
buttons: {
choose: {
files: {
one: 'Choose a file from Instagram',
other: 'Choose files from Instagram'
images: {
one: 'Choose an image from Instagram',
other: 'Choose images from Instagram'
<script src="" charset="utf-8"></script>
var widget = uploadcare.Widget('[role=uploadcare-uploader]')
widget.onUploadComplete(function(info) {
var $resultUrl = document.getElementById('resultUrl')
var $link = document.createElement('a')
$link.href = info.cdnUrl
$ = '_blank'
$link.innerText = info.cdnUrl
$resultUrl.innerHTML = ''
var $resultPreview = document.getElementById('resultPreview')
if(info.isImage) {
$resultPreview.innerHTML =
'<img src="' + info.cdnUrl + '-/preview/50x50/" alt="image preview" /><br>' +
'<img src="' + info.cdnUrl + '-/preview/100x100/" alt="image preview" /><br>' +
'<img src="' + info.cdnUrl + '-/preview/200x200/" alt="image preview" /><br>' +
'<img src="' + info.cdnUrl + '-/preview/300x300/" alt="image preview" /><br>'
} else {
$resultPreview.innerHTML = ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment