Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)
WOLFRAM LANGUAGE SERVICE CONNECTION

Instagram

Connect your Instagram account to the Wolfram Language to import and analyze photos, comments, and followers.

Connecting & AuthenticatingConnecting & Authenticating

    ServiceConnect["Instagram"] creates a connection to the Instagram API. If a previously saved connection can be found, it will be used; otherwise, a new authentication request will be launched.

RequestsRequests

    ServiceExecute[conn,"request",params] sends a request to the connection identified by conn, using parameters params. The following give possible requests.

    User Data

    Requests:

    "UserData" data about the authenticated user's account

    "UserID"  ▪  "Picture"

    Parameters:
  • "UserID"authenticated useruser ID
  • Followers

    Requests:

    "Followers" usernames of the user's followers

    "FollowerIDs" user IDs of the user's followers

    "Followings" usernames of people the user is following

    "FollowingIDs" user IDs of people the user is following

    "FollowingCount"  ▪  "FollowerCount"

    Parameters:
  • "UserID"authenticated useruser ID
  • User Media

    Requests:

    "LatestMedia" import the user's most recent published media

    "LatestPhotos" import a list of the user's most recent published photos

    "LatestVideos" link to the user's most recent videos

    "Liked" photos the user has liked

    "CaptionedLatestPhotos" import a list of the user's most recent published photos with captions

    Parameters:
  • "UserID"authenticated useruser ID
    "Elements""Data"data elements to return
    MaxItems20number of results to return
    "MediaResolution""Standard"media resolution
  • Requests:

    "LatestMediaIDs" import the user's most recent published media IDs

    "LikedIDs" IDs of photos the user has liked

    Parameters:
  • "UserID"authenticated useruser ID
    MaxItems20number of results to return
    "MediaResolution""Standard"media resolution
  • Popular Media

    Requests:

    "PopularMedia" import popular media on Instagram

    "PopularPhotos" import popular photos

    "PopularVideos" links to popular videos

    "CaptionedPopularPhotos" import a list of popular photos with captions

    Parameters:
  • "Elements""Data"data elements to return
    MaxItems20number of results to return
    "MediaResolution""Standard"media resolution
  • Requests:

    "PopularMediaURLs" links to popular media

    "PopularMediaIDs" import popular media IDs

    Parameters:
  • MaxItems20number of results to return
    "MediaResolution""Standard"media resolution
  • Media Data

    Requests:

    "Media" import a photo

    "Caption" usernames of the user's followers

    "Comments" user IDs of the user's followers

    "Likes" usernames of people the user is following

    "Owner" user IDs of people the user is following

    "Type" type of media

    "CommentIDs"  ▪  "CommentCount"  ▪  "LikeIDs"  ▪  "LikeCount"  ▪  "OwnerID"  ▪  "CommentAuthors"  ▪  "CreationDate"  ▪  "Link"  ▪  "Location"  ▪  "MediaID"

    Parameters:
  • "MediaID"(required)media ID
  • Tags

    Requests:

    "TaggedMedia" import media with the specified tag

    Parameters:
  • "Tag"(required)hashtag
    "Elements""Data"data elements to return
    MaxItems20number of results to return
    "MediaResolution""Standard"media resolution
  • Requests:

    "TaggedMediaURLs" link to media with the specified tag

    Parameters:
  • "Tag"(required)hashtag
    MaxItems20number of results to return
    "MediaResolution""Standard"media resolution
  • Requests:

    "TaggedMediaIDs" media IDs associated with a tag

    Parameters:
  • "Tag"(required)hashtag
    MaxItems20number of results to return
  • Search

    Requests:

    "UserSearch" search for users

    "TagSearch" search for hashtags

    Parameters:
  • "Query"(required)query string
  • Request:

    "MediaSearch" search media by location

    Parameters:
  • "Location"(required)location of media (GeoPosition, GeoDisk, or Entity)
    "Elements"Datadata elements to return
    "Distance"1000search distance in meters
    MaxItems20number of results to return
    "MediaResolution""Standard"media resolution

Parameter DetailsParameter Details

    Possible settings for "Elements" include:
  • "Images"return a list of images
    "Data"return a dataset with a limited set of fields
    "FullData"return a dataset with all available fields
    "LinkedThumbnails"return a list of hyperlinked thumbnails
    "LinkedVideos"return a list of hyperlinked videos
  • Possible settings for "MediaResolution" include:
  • "Low"return low-resolution media
    "Standard"return standard-resolution media

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Create a new connection by launching an authentication dialog:

In[1]:=
Click for copyable input
Out[1]=

Search for a user:

In[2]:=
Click for copyable input
Out[2]=

Import recent media from a user:

In[3]:=
Click for copyable input
Out[3]=

Import recent media from a user with full information:

Find who is following a user:

In[4]:=
Click for copyable input
Out[4]=

Search for media by hashtag:

In[5]:=
Click for copyable input
Out[5]=

Search for recent media taken near a given location:

In[6]:=
Click for copyable input
Out[6]=