Skip to content

Latest commit

 

History

History
1666 lines (1330 loc) · 57.8 KB

InstagramApi.md

File metadata and controls

1666 lines (1330 loc) · 57.8 KB

InstagramApi

All URIs are relative to https://api.unifapi.com

Method HTTP request Description
instagramExploreGet GET /instagram/explore Browse Instagram's Explore feed
instagramLocationsIdGet GET /instagram/locations/{id} Get an Instagram location by id
instagramLocationsIdNearbyGet GET /instagram/locations/{id}/nearby List Instagram locations geographically near a given location
instagramLocationsIdPostsGet GET /instagram/locations/{id}/posts List posts tagged with an Instagram location
instagramPostsShortcodeCommentsCommentIdRepliesGet GET /instagram/posts/{shortcode}/comments/{commentId}/replies List replies to an Instagram comment
instagramPostsShortcodeCommentsGet GET /instagram/posts/{shortcode}/comments List comments on an Instagram post
instagramPostsShortcodeGet GET /instagram/posts/{shortcode} Get an Instagram post (photo / video / carousel / reel) by shortcode
instagramReelsRecommendedGet GET /instagram/reels/recommended Browse Instagram's recommended Reels feed
instagramResolveMediaIdGet GET /instagram/resolve/media-id Convert an Instagram post shortcode into its numeric media_id
instagramResolveShortcodeFromMediaGet GET /instagram/resolve/shortcode-from-media Convert an Instagram numeric media_id into its shortcode
instagramResolveShortcodeGet GET /instagram/resolve/shortcode Extract a post shortcode from an Instagram URL
instagramResolveUserIdGet GET /instagram/resolve/user-id Convert an Instagram username into its numeric user_id (pk)
instagramSearchGet GET /instagram/search Cross-type Instagram search (posts/reels)
instagramUsersUsernameFollowersGet GET /instagram/users/{username}/followers List followers of an Instagram user
instagramUsersUsernameFollowingGet GET /instagram/users/{username}/following List accounts an Instagram user follows
instagramUsersUsernameFormerUsernamesGet GET /instagram/users/{username}/former-usernames List former usernames for an Instagram user
instagramUsersUsernameGet GET /instagram/users/{username} Get an Instagram user profile by username
instagramUsersUsernameHighlightsGet GET /instagram/users/{username}/highlights List Instagram highlight reels for a user (metadata only)
instagramUsersUsernamePostsGet GET /instagram/users/{username}/posts List feed posts authored by an Instagram user
instagramUsersUsernameReelsGet GET /instagram/users/{username}/reels List reels authored by an Instagram user
instagramUsersUsernameStoriesGet GET /instagram/users/{username}/stories List active Instagram stories for a user
instagramUsersUsernameTaggedPostsGet GET /instagram/users/{username}/tagged-posts List posts an Instagram user is tagged in

instagramExploreGet

InstagramExploreGet200Response instagramExploreGet(cursor)

Browse Instagram's Explore feed

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String cursor = "cursor_example"; // String | 
    try {
      InstagramExploreGet200Response result = apiInstance.instagramExploreGet(cursor);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramExploreGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
cursor String [optional]

Return type

InstagramExploreGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramLocationsIdGet

InstagramLocationsIdGet200Response instagramLocationsIdGet(id)

Get an Instagram location by id

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String id = "id_example"; // String | Numeric Instagram location id.
    try {
      InstagramLocationsIdGet200Response result = apiInstance.instagramLocationsIdGet(id);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramLocationsIdGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
id String Numeric Instagram location id.

Return type

InstagramLocationsIdGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramLocationsIdNearbyGet

InstagramLocationsIdNearbyGet200Response instagramLocationsIdNearbyGet(id)

List Instagram locations geographically near a given location

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String id = "id_example"; // String | 
    try {
      InstagramLocationsIdNearbyGet200Response result = apiInstance.instagramLocationsIdNearbyGet(id);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramLocationsIdNearbyGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
id String

Return type

InstagramLocationsIdNearbyGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramLocationsIdPostsGet

InstagramExploreGet200Response instagramLocationsIdPostsGet(id, cursor, tab)

List posts tagged with an Instagram location

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String id = "id_example"; // String | 
    String cursor = "cursor_example"; // String | 
    String tab = "ranked"; // String | Which tab to fetch — `ranked` (top) or `recent` (latest).
    try {
      InstagramExploreGet200Response result = apiInstance.instagramLocationsIdPostsGet(id, cursor, tab);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramLocationsIdPostsGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
id String
cursor String [optional]
tab String Which tab to fetch — `ranked` (top) or `recent` (latest). [optional] [enum: ranked, recent]

Return type

InstagramExploreGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramPostsShortcodeCommentsCommentIdRepliesGet

InstagramPostsShortcodeCommentsCommentIdRepliesGet200Response instagramPostsShortcodeCommentsCommentIdRepliesGet(shortcode, commentId, cursor)

List replies to an Instagram comment

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String shortcode = "shortcode_example"; // String | 
    String commentId = "commentId_example"; // String | 
    String cursor = "cursor_example"; // String | 
    try {
      InstagramPostsShortcodeCommentsCommentIdRepliesGet200Response result = apiInstance.instagramPostsShortcodeCommentsCommentIdRepliesGet(shortcode, commentId, cursor);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramPostsShortcodeCommentsCommentIdRepliesGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
shortcode String
commentId String
cursor String [optional]

Return type

InstagramPostsShortcodeCommentsCommentIdRepliesGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramPostsShortcodeCommentsGet

InstagramPostsShortcodeCommentsCommentIdRepliesGet200Response instagramPostsShortcodeCommentsGet(shortcode, cursor, sort)

List comments on an Instagram post

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String shortcode = "shortcode_example"; // String | 
    String cursor = "cursor_example"; // String | 
    String sort = "popular"; // String | 
    try {
      InstagramPostsShortcodeCommentsCommentIdRepliesGet200Response result = apiInstance.instagramPostsShortcodeCommentsGet(shortcode, cursor, sort);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramPostsShortcodeCommentsGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
shortcode String
cursor String [optional]
sort String [optional] [enum: popular, newest]

Return type

InstagramPostsShortcodeCommentsCommentIdRepliesGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramPostsShortcodeGet

InstagramPostsShortcodeGet200Response instagramPostsShortcodeGet(shortcode)

Get an Instagram post (photo / video / carousel / reel) by shortcode

`shortcode` is the slug from the post URL, e.g. `DUajw4YkorV` in `instagram.com/p/DUajw4YkorV/`.

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String shortcode = "shortcode_example"; // String | 
    try {
      InstagramPostsShortcodeGet200Response result = apiInstance.instagramPostsShortcodeGet(shortcode);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramPostsShortcodeGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
shortcode String

Return type

InstagramPostsShortcodeGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramReelsRecommendedGet

InstagramExploreGet200Response instagramReelsRecommendedGet(cursor)

Browse Instagram's recommended Reels feed

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String cursor = "cursor_example"; // String | 
    try {
      InstagramExploreGet200Response result = apiInstance.instagramReelsRecommendedGet(cursor);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramReelsRecommendedGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
cursor String [optional]

Return type

InstagramExploreGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramResolveMediaIdGet

InstagramResolveMediaIdGet200Response instagramResolveMediaIdGet(shortcode)

Convert an Instagram post shortcode into its numeric media_id

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String shortcode = "shortcode_example"; // String | 
    try {
      InstagramResolveMediaIdGet200Response result = apiInstance.instagramResolveMediaIdGet(shortcode);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramResolveMediaIdGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
shortcode String

Return type

InstagramResolveMediaIdGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramResolveShortcodeFromMediaGet

InstagramResolveMediaIdGet200Response instagramResolveShortcodeFromMediaGet(mediaId)

Convert an Instagram numeric media_id into its shortcode

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String mediaId = "mediaId_example"; // String | 
    try {
      InstagramResolveMediaIdGet200Response result = apiInstance.instagramResolveShortcodeFromMediaGet(mediaId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramResolveShortcodeFromMediaGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
mediaId String

Return type

InstagramResolveMediaIdGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramResolveShortcodeGet

InstagramResolveShortcodeGet200Response instagramResolveShortcodeGet(url)

Extract a post shortcode from an Instagram URL

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    URI url = new URI(); // URI | 
    try {
      InstagramResolveShortcodeGet200Response result = apiInstance.instagramResolveShortcodeGet(url);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramResolveShortcodeGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
url URI

Return type

InstagramResolveShortcodeGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramResolveUserIdGet

InstagramResolveUserIdGet200Response instagramResolveUserIdGet(username)

Convert an Instagram username into its numeric user_id (pk)

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String username = "username_example"; // String | 
    try {
      InstagramResolveUserIdGet200Response result = apiInstance.instagramResolveUserIdGet(username);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramResolveUserIdGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
username String

Return type

InstagramResolveUserIdGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramSearchGet

InstagramExploreGet200Response instagramSearchGet(q, cursor)

Cross-type Instagram search (posts/reels)

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String q = "q_example"; // String | Search keyword.
    String cursor = "cursor_example"; // String | 
    try {
      InstagramExploreGet200Response result = apiInstance.instagramSearchGet(q, cursor);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramSearchGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
q String Search keyword.
cursor String [optional]

Return type

InstagramExploreGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramUsersUsernameFollowersGet

InstagramUsersUsernameFollowersGet200Response instagramUsersUsernameFollowersGet(username, cursor)

List followers of an Instagram user

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String username = "username_example"; // String | 
    String cursor = "cursor_example"; // String | 
    try {
      InstagramUsersUsernameFollowersGet200Response result = apiInstance.instagramUsersUsernameFollowersGet(username, cursor);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramUsersUsernameFollowersGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
username String
cursor String [optional]

Return type

InstagramUsersUsernameFollowersGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramUsersUsernameFollowingGet

InstagramUsersUsernameFollowersGet200Response instagramUsersUsernameFollowingGet(username, cursor)

List accounts an Instagram user follows

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String username = "username_example"; // String | 
    String cursor = "cursor_example"; // String | 
    try {
      InstagramUsersUsernameFollowersGet200Response result = apiInstance.instagramUsersUsernameFollowingGet(username, cursor);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramUsersUsernameFollowingGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
username String
cursor String [optional]

Return type

InstagramUsersUsernameFollowersGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramUsersUsernameFormerUsernamesGet

InstagramUsersUsernameFormerUsernamesGet200Response instagramUsersUsernameFormerUsernamesGet(username)

List former usernames for an Instagram user

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String username = "username_example"; // String | 
    try {
      InstagramUsersUsernameFormerUsernamesGet200Response result = apiInstance.instagramUsersUsernameFormerUsernamesGet(username);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramUsersUsernameFormerUsernamesGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
username String

Return type

InstagramUsersUsernameFormerUsernamesGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramUsersUsernameGet

InstagramUsersUsernameGet200Response instagramUsersUsernameGet(username)

Get an Instagram user profile by username

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String username = "username_example"; // String | Instagram URL slug, e.g. `instagram`
    try {
      InstagramUsersUsernameGet200Response result = apiInstance.instagramUsersUsernameGet(username);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramUsersUsernameGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
username String Instagram URL slug, e.g. `instagram`

Return type

InstagramUsersUsernameGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramUsersUsernameHighlightsGet

InstagramUsersUsernameHighlightsGet200Response instagramUsersUsernameHighlightsGet(username, cursor)

List Instagram highlight reels for a user (metadata only)

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String username = "username_example"; // String | 
    String cursor = "cursor_example"; // String | 
    try {
      InstagramUsersUsernameHighlightsGet200Response result = apiInstance.instagramUsersUsernameHighlightsGet(username, cursor);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramUsersUsernameHighlightsGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
username String
cursor String [optional]

Return type

InstagramUsersUsernameHighlightsGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramUsersUsernamePostsGet

InstagramExploreGet200Response instagramUsersUsernamePostsGet(username, cursor)

List feed posts authored by an Instagram user

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String username = "username_example"; // String | 
    String cursor = "cursor_example"; // String | 
    try {
      InstagramExploreGet200Response result = apiInstance.instagramUsersUsernamePostsGet(username, cursor);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramUsersUsernamePostsGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
username String
cursor String [optional]

Return type

InstagramExploreGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramUsersUsernameReelsGet

InstagramExploreGet200Response instagramUsersUsernameReelsGet(username, cursor)

List reels authored by an Instagram user

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String username = "username_example"; // String | 
    String cursor = "cursor_example"; // String | 
    try {
      InstagramExploreGet200Response result = apiInstance.instagramUsersUsernameReelsGet(username, cursor);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramUsersUsernameReelsGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
username String
cursor String [optional]

Return type

InstagramExploreGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramUsersUsernameStoriesGet

InstagramExploreGet200Response instagramUsersUsernameStoriesGet(username)

List active Instagram stories for a user

Returns the user's currently-live story tray (empty when the user has no active stories).

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String username = "username_example"; // String | 
    try {
      InstagramExploreGet200Response result = apiInstance.instagramUsersUsernameStoriesGet(username);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramUsersUsernameStoriesGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
username String

Return type

InstagramExploreGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

instagramUsersUsernameTaggedPostsGet

InstagramExploreGet200Response instagramUsersUsernameTaggedPostsGet(username, cursor)

List posts an Instagram user is tagged in

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.InstagramApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    InstagramApi apiInstance = new InstagramApi(defaultClient);
    String username = "username_example"; // String | 
    String cursor = "cursor_example"; // String | 
    try {
      InstagramExploreGet200Response result = apiInstance.instagramUsersUsernameTaggedPostsGet(username, cursor);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling InstagramApi#instagramUsersUsernameTaggedPostsGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
username String
cursor String [optional]

Return type

InstagramExploreGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -