Instagram

Capture and share the world's moments.

iPhone Hooks

We provide several ways in which your iPhone app can interact with ours, through custom URL schemes and through the Document Interaction API.

Custom URL Scheme

Opening instagram://, followed by one of the following parameters, will open our app and perform a custom action. For example, for camera, you would direct users on the iPhone to the custom URL instagram://camera.

URL OPENS
app The Instagram app
camera The camera (or photo library on non-camera devices)
media?id=MEDIA_ID Media with this ID
user?username=USERNAME User with this username
location?id=LOCATION_ID Location feed for this location ID
tag?name=TAG Tag feed for this tag

The Objective-C call to open one of these URLs is as follows:

NSURL *instagramURL = [NSURL URLWithString:@"instagram://location?id=1"]; if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) { [[UIApplication sharedApplication] openURL:instagramURL]; } 

Document Interaction

If your application creates photos and you'd like your users to share these photos using Instagram, you can use the Document Interaction API to open your photo in Instagram's sharing flow.

You must first save your file in PNG or JPEG (preferred) format and use the filename extension ".ig". Using the iOS Document Interaction APIs you can trigger the photo to be opened by Instagram. The Identifier for our Document Interaction UTI is com.instagram.photo, and it conforms to the public/jpeg and public/png UTIs. See the Apple documentation articles: Previewing and Opening Files and the UIDocumentInteractionController Class Reference for more information.

Alternatively, if you want to show only Instagram in the application list (instead of Instagram plus any other public/jpeg-conforming apps) you can specify the extension class igo, which is of type com.instagram.exclusivegram.

When triggered, Instagram will immediately present the user with our filter screen. The image is preloaded and sized appropriately for Instagram. For best results, Instagram prefers opening a JPEG that is 640px by 640px square. If the image is larger, it will be resized dynamically.

To include a pre-filled caption with your photo, you can set the annotation property on the document interaction request to an NSDictionary containing an NSString under the key "InstagramCaption". This feature is available on Instagram 2.1 and later.