{"id":5250,"date":"2023-05-29T06:03:48","date_gmt":"2023-05-29T06:03:48","guid":{"rendered":"https:\/\/unremot.com\/blog\/?p=5250"},"modified":"2023-05-29T07:34:18","modified_gmt":"2023-05-29T07:34:18","slug":"how-to-use-instagram-api","status":"publish","type":"post","link":"https:\/\/unremot.com\/blog\/how-to-use-instagram-api\/","title":{"rendered":"How to use\u00a0Instagram\u00a0API &#8211; a step-by-step integration guide and full documentation list"},"content":{"rendered":"<p>This article will discuss about how to use Instagram API with step-by-step integration guide and full documentation list. Let&#8217;s get started!<\/p>\n\n<h2><b>Overview of\u00a0Instagram\u00a0API<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Instagram is a photo and video-sharing platform and is one of the leading social media platforms in the world with over 1 billion people using the app every month. Instagram API for developers allows them to publish content, manage content, and access public data. Developers can use the API to create applications that interact with Instagram. Instagram API for websites allows businesses to manage their Instagram presence more effectively and track their performance on the platform.\u00a0<\/span><\/p>\n<p style=\"text-align: center;\"><strong>Also read:\u00a0<a href=\"https:\/\/unremot.com\/blog\/how-to-use-shopify-api\/\">How to use Shopify API; a step-by-step integration guide and full documentation list<\/a><\/strong><\/p>\n<h2><b>List of\u00a0<\/b><b>Instagram<\/b><b>\u00a0developer API and functionalities<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Does Instagram have an API? Yes Instagram API helps developers develop programs that interact with Instagram. Here are some developer API Instagram and their functionalities listed below<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Instagram Graph API \u2013 Your app can access information from business and personal accounts using Instagram Graph API. You can use the API to obtain and publish their media, manage and respond to comments left on your content, locate content that has been hash tagged, find media where you have been @mentioned by other Instagram users, and obtain basic metadata and stats about other Instagram Businesses and Creators. You can think of Instagram Graph API as an Instagram business API because it was created specifically for businesses and creators.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Instagram Basic Display API \u2013 You can access the fundamental profile, images, and videos using this API.\u00a0 The Instagram Basic Display API to create applications that news feeds and photo galleries.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Instagram Messaging= Your app can handle your Instagram messages for your professional account using Instagram messaging API. You can use this API to send and receive messages from other Instagram users.\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Sharing to stories \u2013 You can share material from your app to Instagram using this API. It can be used to create applications that let users post their images, videos, links to their stories<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Sharing to feed \u2013 You can share content from your app to Instagram Feed using this API.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Embedding \u2013 You can use this API to embed Instagram stories on your API and website. You can use it to create applications that lets people view Instagram content without leaving the app.\u00a0<\/span><\/li>\n<\/ul>\n<p style=\"text-align: center;\"><strong>Also read:\u00a0<a href=\"https:\/\/unremot.com\/blog\/how-to-use-stripe-api\/\">How to use Stripe API; a step-by-step integration guide and full documentation list<\/a><\/strong><\/p>\n<h2><b>How to use\u00a0Instagram\u00a0API &#8211; step-by-step integration guide<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Like most APIs Instagram Open API requires you to get a unique key that will let you access API features and capabilities on your website or Apps. Before using Instagram API you need to have:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">A Facebook account<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">A Facebook page, a dedicated testing page<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">An Instagram Account<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">You need to turn your Instagram account into a business account and link it to your Facebook page. Here are step-by-step integration guide<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">Head to the App Dashboard of your Facebook app.\u00a0<\/span><\/li>\n<li><span style=\"font-weight: 400;\">On the sidebar, click the button that says <\/span><i><span style=\"font-weight: 400;\">Product.<\/span><\/i><\/li>\n<li><span style=\"font-weight: 400;\">Click set-up on the Facebook Login Product card.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Enter your Facebook Login setting. Make sure all the options are set to default.\u00a0<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Finish implementing Facebook Login into your app depending on your target device (iOS, Web, Android. bsite\/instagram-api-examples<\/span><\/li>\n<li><span style=\"font-weight: 400;\">In your implementation, configure it to request these permissions:<\/span><i><span style=\"font-weight: 400;\">instagram_basic, pages_show_list<\/span><\/i><\/li>\n<li><span style=\"font-weight: 400;\">Return to your app and Login using your Facebook credentials. Ensure you are also logged into your Facebook Developers account.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Click Ok to give your app the permissions (instagram_basic, pages_show_list) you set up earlier.\u00a0<\/span><\/li>\n<li><span style=\"font-weight: 400;\">You should now see instagram\u00a0api access token on the screen.\u00a0<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">You can use this Instagram API access key to retrieve your user pages, Instagram Business Object, and Media objects.\u00a0<\/span><\/p>\n<p style=\"text-align: center;\"><strong>Also read:\u00a0<a href=\"https:\/\/unremot.com\/blog\/how-to-use-youtube-api\/\">How To Use YouTube API; A Step-By-Step Guide To Integrate And Full Documentation List<\/a><\/strong><\/p>\n<h2><b>Instagram\u00a0API documentation n references<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Instagram API documentation references offer detailed instruction on how to use Instagram API. The Instagram API contains the following\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Overview \u2013 the overview acts as an introduction to Instagram API docs offers instructions on how to use the API.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Get Started- Explore the API using the API explorer tool and find frequent requests easily.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Guides \u2013 Provides in-depth instructions on how to use the API to carry out specific tasks such as gather user data, upload photographs, and moderate comments.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">References- the section provides detailed references of all the endpoints and fields available in the API.\u00a0<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">The Instagram API documentation is an excellent resource to build apps, integration, and other tools. The documentation is easy to understand and follow. It is a great starting point for any coder wanting to learn the API.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">There are other useful resources to learn more about API given below<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The Instagram Developer Blog:\u00a0Gives details about the latest tools to manage your business.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The Instagram Developer Forum: It is a community of 1000 of developer from countries around the world. It is a great place to ask questions and get help from other developers.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The Instagram API SDKs: The Instagram API SDKs provide a convenient way to use the API in a variety of programming languages.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">These are all the resources you need to build a great program. We recommend you read the documentation in chronological order to avoid confusion. There are several great examples to help you learn to use the API.<\/span><\/p>\n<h2><b>Instagram\u00a0API examples<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Instagram <\/span><span style=\"font-weight: 400;\">API\u00a0 <\/span><span style=\"font-weight: 400;\">is a powerful tool to build the apps or integration. In this section, we focus on some Instagram API examples. The Instagram API is frequently used to create applications that let people browse and engage with Instagram content. It can also be used to build applications to let users manage their accounts or provide insights into Instagram data.\u00a0<\/span><span style=\"font-weight: 400;\">Before you start you need\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">A Meta developer account\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">A registered Meta App with basic settings configured.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Your app secret<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">An Ad account<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">A Page access token<\/span><\/li>\n<\/ul>\n<h3><b>How to use\u00a0Instagram\u00a0API Python<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">To use Instagram API Python you will need to\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step1: <\/strong>Install Python on your computer.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">For this we will be using a Windows computer. You can check the program with a simple code<\/span><\/p>\n<p><span style=\"font-weight: 400;\">#!\/usr\/bin\/env python<\/span><\/p>\n<p><span style=\"font-weight: 400;\">import sys<\/span><\/p>\n<p><span style=\"font-weight: 400;\">sys.stdout.write(&#8220;hello from Python %sn&#8221; % (sys.version,))<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0When you run the hello.py you should get the output\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&gt;<\/span><span style=\"font-weight: 400;\">python hello.py<\/span><\/p>\n<p><span style=\"font-weight: 400;\">hello from Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 07:18:10) [MSC v.1900 32 bit (Intel)]<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step2:<\/strong> <\/span><span style=\"font-weight: 400;\">Install the Instagram API Python library.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The Instagram API Python library is available on <\/span><a href=\"https:\/\/pip.pypa.io\/en\/stable\/installing\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">pypi module<\/span><\/a><span style=\"font-weight: 400;\">. You can install it with the following command:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">pip install instagram-python<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step3:<\/strong> Configure your Python environment with your API keys.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Use your API Key to configure to your Python environment, you will need to add the following variables.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">INSTAGRAM_API_KEY=YOUR_API_KEY<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step4:<\/strong> Write Python code to make a request to API\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Create a project file test.py with the following content <\/span><span style=\"font-weight: 400;\">Replace\u00a0{app-id},\u00a0{access-token},\u00a0{appsecret}, and\u00a0{adaccount-id}\u00a0with your values.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">from facebook_business.api import FacebookAdsApi<\/span><\/p>\n<p><span style=\"font-weight: 400;\">from facebook_business.adobjects.adaccount import AdAccount<\/span><\/p>\n<p><span style=\"font-weight: 400;\">my_app_id = &#8216;{app-id}&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">my_app_secret = &#8216;{appsecret}&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">my_access_token = &#8216;{access-token}&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">FacebookAdsApi.init(my_app_id, my_app_secret, my_access_token)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">my_account = AdAccount(&#8216;act_{{adaccount-id}}&#8217;)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">campaigns = my_account.get_campaigns()<\/span><\/p>\n<p><span style=\"font-weight: 400;\">print(campaigns)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Remember to test your install with <\/span><span style=\"font-weight: 400;\">If it complains about an expired token, request a new Page Access Token and retry.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">python test.py<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You should see the results on the terminal window. If there are complaints about expired tokens you may have request new Page Access and retry.\u00a0<\/span><\/p>\n<h3><b>How to use\u00a0<\/b><b>Instagram<\/b><b>\u00a0API Javascript<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The Instagram API Javascript is distributed through <\/span><span style=\"font-weight: 400;\">\u00a0<\/span><a href=\"https:\/\/docs.npmjs.com\/getting-started\/installing-node\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Node.js package<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step1:<\/strong> Open your command terminal window and create a new project folder. Create, configure, and install your project with the following command\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You can update your configuration settings later by editing the\u00a0<\/span><span style=\"font-weight: 400;\">package.json<\/span><span style=\"font-weight: 400;\">\u00a0file directly.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step2:<\/strong> Install the SDK<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Install the SDK package with the following command:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">npm install &#8211;save facebook-nodejs-business-sdk<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step3:<\/strong> Modify the project file\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Open the\u00a0index.js\u00a0file and add the following code. Replace\u00a0{access-token}, and\u00a0{adaccount-id}\u00a0with your values.<\/span><span style=\"font-weight: 400;\">\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">const bizSdk = require(&#8216;facebook-nodejs-business-sdk&#8217;);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">const accessToken = &#8216;{access-token}&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">const accountId = &#8216;act_{{adaccount-id}}&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">const FacebookAdsApi = bizSdk.FacebookAdsApi.init(accessToken);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">const AdAccount = bizSdk.AdAccount;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">const Campaign = bizSdk.Campaign;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">const account = new AdAccount(accountId);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">var campaigns;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">account.read([AdAccount.Fields.name])<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0.then((account) =&gt;{<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0return account.getCampaigns([Campaign.Fields.name], { limit: 10 }) \/\/ fields array and params<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0})<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0.then((result) =&gt;{<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0campaigns = result<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0campaigns.forEach((campaign) =&gt;console.log(campaign.name))\u00a0\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0}).catch(console.error);<\/span><\/p>\n<p><b>Step4: Test Your Install<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Test your install with the following command<\/span><\/p>\n<p><span style=\"font-weight: 400;\">node index.js<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You should see the result in your terminal window. If it complains about an expired token, request a new Page Access Token and retry.<\/span><\/p>\n<h3><b>How to use\u00a0Instagram\u00a0API PHP<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">For PHP we recommend you use <\/span><span style=\"font-weight: 400;\">\u00a0<\/span><a href=\"https:\/\/getcomposer.org\/download\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Composer<\/span><\/a><span style=\"font-weight: 400;\">\u00a0to install the SDK.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step1:<\/strong> Install the SDK\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In a new project folder, create\u00a0composer.json\u00a0with the following content. Replace\u00a0{project-name},\u00a0{Your Name}, and\u00a0{your@email.com}\u00a0with your values.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">{<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0&#8220;name&#8221;: &#8220;name\/{project-name}&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0&#8220;type&#8221;: &#8220;project&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0&#8220;require&#8221;: {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#8220;facebook\/php-business-sdk&#8221;: &#8220;^8.0.3&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0},<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0&#8220;authors&#8221;: [<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#8220;name&#8221;: &#8220;{Your Name}&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#8220;email&#8221;: &#8220;{your@email.com}&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0]<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Install the SDK by running the following command in your terminal window:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">composer install<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step2:<\/strong> Create a Project File<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Create a\u00a0src\/test.php\u00a0file with the following content. Replace\u00a0{app-id},\u00a0{access-token},\u00a0{appsecret}, and\u00a0{adaccount-id}\u00a0with your values.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;?php<\/span><\/p>\n<p><span style=\"font-weight: 400;\">require_once __DIR__ . &#8216;\/..\/vendor\/autoload.php&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">use FacebookAds\\Api;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">use FacebookAds\\Logger\\CurlLogger;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">use FacebookAds\\Object\\AdAccount;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">use FacebookAds\\Object\\Campaign;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">use FacebookAds\\Object\\Fields\\CampaignFields;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">$app_id = &#8220;{app-id}&#8221;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">$app_secret = &#8220;{appsecret}&#8221;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">$access_token = &#8220;{access-token}&#8221;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">$account_id = &#8220;act_{{adaccount-id}}&#8221;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Api::init($app_id, $app_secret, $access_token);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">$account = new AdAccount($account_id);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">$cursor = $account-&gt;getCampaigns();<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\/\/ Loop over objects<\/span><\/p>\n<p><span style=\"font-weight: 400;\">foreach ($cursor as $campaign) {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0echo $campaign-&gt;{CampaignFields<\/span><span style=\"font-weight: 400;\">:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><b>Step3: Test Your Install<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Test your install with the following command:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">php src\/test.php<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You should see the result in your terminal window.<\/span><\/p>\n<h3><b>How to use\u00a0<\/b><b>Instagram<\/b><b>\u00a0API tutorial Android<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Here is how to use Instagram API tutorial Android<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step1:<\/strong> Create an Instagram developer account\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Go to <\/span><span style=\"font-weight: 400;\">Create an Instagram developer <a href=\"https:\/\/www.instagram.com\/developer\/\" target=\"_blank\" rel=\"noopener\">account<\/a>. <\/span><span style=\"font-weight: 400;\">After you create an account you will be able to register.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\"><strong>Step2:<\/strong> Register your App and get client ID and client Secret.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To register your app, go to the Instagram Developer Dashboard and click on &#8220;Register App&#8221;. Fill out the form and click on &#8220;Register&#8221;. You will be given your client ID and client secret.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step3:<\/strong> Add Instagram SDK to your project<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The Instagram SDK is available for Android Studio. You can add it to your project by following these steps:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Open your project in Android Studio.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the toolbar, click on &#8220;File&#8221; &gt; &#8220;Settings&#8221;.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the &#8220;Plugins&#8221; tab, search for &#8220;Instagram SDK&#8221; and click on the &#8220;Install&#8221; button.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click on &#8220;Restart Android Studio&#8221;.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Create an InstagramSession object and authenticate the user.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">To create an InstagramSession object, you need to pass in your client ID, client secret, and the redirect URI that you specified when you registered your app. You can then use the InstagramSession object to authenticate the user.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To authenticate the user, you need to call the <\/span><span style=\"font-weight: 400;\">authenticate()<\/span><span style=\"font-weight: 400;\"> method on the InstagramSession object. This will open a web browser where the user can log in to Instagram. Once the user has logged in, the web browser will close and the InstagramSession object will be authenticated.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Make API calls to get user data, posts, and other information.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Once you have authenticated the user, you can make API calls to get user data, posts, and other information. To make an API call, you need to create an <\/span><span style=\"font-weight: 400;\">InstagramAPI<\/span><span style=\"font-weight: 400;\"> object and pass in the authenticated InstagramSession object. You can then call the methods on the <\/span><span style=\"font-weight: 400;\">InstagramAPI<\/span><span style=\"font-weight: 400;\"> object to get the data that you want.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here are some examples of API calls that you can make: to get user profile information<\/span><\/p>\n<p><span style=\"font-weight: 400;\">InstagramAPI api = new InstagramAPI(session);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">User user = api.getUser();<\/span><\/p>\n<h3><b>How to use\u00a0<\/b><b>Instagram<\/b><b>\u00a0JQuery API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Here are how to use Instagram JQuery API<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Almost all Instagram feed plugins (like\u00a0<\/span><a href=\"https:\/\/www.jqueryscript.net\/social-media\/Instagram-Photos-Without-API-instagramFeed.html\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">jQuery instagramFeed<\/span><\/a><span style=\"font-weight: 400;\">) that do not require the Instagram API have been broken since the latest Instagram changes.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To address this, I recommend using this jQuery script to display your Instagram feed on the webpage using the official Instagram Graph API and AJAX requests<\/span><\/p>\n<p><strong>Step1:<\/strong> Create a container to hold your Instagram feed.<\/p>\n<p><span style=\"font-weight: 400;\">&lt;<\/span><b>div<\/b><span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">id=&#8221;instagram-feed1&#8243;<\/span><span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">class=&#8221;instagram_feed&#8221;&gt;&lt;\/<\/span><b>div<\/b><span style=\"font-weight: 400;\">&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Insert your Instagram authorization token into the\u00a0<\/span><span style=\"font-weight: 400;\">jquery-feed-instagram-<\/span><\/p>\n<p><span style=\"font-weight: 400;\">graph.js<\/span><span style=\"font-weight: 400;\">. See\u00a0<\/span><a href=\"https:\/\/www.mageplaza.com\/kb\/how-to-get-instagram-feed-access-token.html\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">How to get Instagram Feed Access Token<\/span><\/a><span style=\"font-weight: 400;\">\u00a0for details .<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\/\/ jquery-feed-instagram-graph.js<\/span><\/p>\n<p><b>var<\/b><span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">token =&#8217;YOUR INSTGRAM TOKEN HERE&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Determine the number of Instagram items to show. Default: 6.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\/\/ jquery-feed-instagram-graph.js<\/span><\/p>\n<p><b>var<\/b><span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">limit = 8;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Insert the\u00a0<\/span><span style=\"font-weight: 400;\">jquery-feed-instagram-graph.js<\/span><span style=\"font-weight: 400;\">\u00a0after jQuery and done.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;script src=<\/span><span style=\"font-weight: 400;\">&#8220;\/path\/to\/cdn\/jquery.min.js&#8221;<\/span><span style=\"font-weight: 400;\">&gt;&lt;\/script&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;script src=<\/span><span style=\"font-weight: 400;\">&#8220;\/path\/to\/jquery-feed-instagram-graph.js&#8221;<\/span><span style=\"font-weight: 400;\">&gt;&lt;\/script&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step2:<\/strong> Apply your own CSS styles to the Instagram feed.<\/span><\/p>\n<p><a href=\"https:\/\/www.jqueryscript.net\/social-media\/instagram-feed-graph-api.html#viewSource\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">view source<\/span><\/a><\/p>\n<p><span style=\"font-weight: 400;\">.instagram_feed {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0overflow: hidden;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">.instagram_feed .instagram_new {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0width: 16.666%;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0float: left;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0padding: 0 1px 1px 0;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0-webkit-box-sizing: border-box;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0-moz-box-sizing: border-box;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0box-sizing: border-box;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">.instagram_feed img.insta-image {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0position: absolute;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0left: 0;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0top: 0;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0object-fit: cover;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0width: 100%;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0height: 100%;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0transition: all 0.3s ease 0s;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0-webkit-transition: all 0.3s ease 0s;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0-moz-transition: all 0.3s ease 0s;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0-ms-transition: all 0.3s ease 0s;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0-o-transition: all 0.3s ease 0s;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">.instagram_feed .insta-link {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0position: relative;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0display: block;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0background: #232323;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0padding-top: 100%;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">.instagram_feed .insta-link:hover .insta-image {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0opacity: 0.2;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">How to use\u00a0Instagram\u00a0API Nodejs<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To learn to use Instagram API NodeJs you need to have\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Node JS installed on your computer.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Working knowledge GraphQl<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Working Knowledge of Javascript<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">1. Create a Facebook App<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Follow steps 1 to 3 from this <a href=\"https:\/\/developers.facebook.com\/docs\/instagram-basic-display-api\/getting-started\" target=\"_blank\" rel=\"noopener\">link<\/a>.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">2. Get Access Tokens<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Proceeding further requires app-specific keys and secrets which can be found here.<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">App <\/span><\/i><i><span style=\"font-weight: 400;\">\u21d2<\/span><\/i><i><span style=\"font-weight: 400;\"> Dashboard <\/span><\/i><i><span style=\"font-weight: 400;\">\u21d2<\/span><\/i><i><span style=\"font-weight: 400;\"> My products <\/span><\/i><i><span style=\"font-weight: 400;\">\u21d2<\/span><\/i><i><span style=\"font-weight: 400;\"> Instagram Basic Display <\/span><\/i><i><span style=\"font-weight: 400;\">\u21d2<\/span><\/i><i><span style=\"font-weight: 400;\"> Settings<\/span><\/i><\/p>\n<p><span style=\"font-weight: 400;\">App ID is required on the frontend only; backend requires both ID &amp; secret. Since App secret can\u2019t be shown to users, it\u2019s kept as an environment variable on the server.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Also, add your frontend application\u2019s URL to\u00a0<\/span>Valid OAuth Redirect URIs.<span style=\"font-weight: 400;\">\u00a0l<\/span><a href=\"http:\/\/localhost\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">ocalhost<\/span><\/a><span style=\"font-weight: 400;\">\u00a0with https will work. Hosting static app on\u00a0<\/span><a href=\"https:\/\/pages.github.com\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">GitHub pages<\/span><\/a><span style=\"font-weight: 400;\">\u00a0will do and is a better option.<\/span><\/p>\n<p><strong>Frontend<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Use this piece of code on a static frontend site to get a short-lived access token. Short-lived access tokens are valid for 1 hour but can be exchanged for long-lived tokens (will do later on server-side).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Since our goal is to fetch user-related info and their Instagram photos, scopes are set to\u00a0<\/span><span style=\"font-weight: 400;\">user_profile<\/span><span style=\"font-weight: 400;\">\u00a0&amp;\u00a0<\/span><span style=\"font-weight: 400;\">user_media<\/span><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\/\/ Invoke this function on button click or whatever other use case<\/span><\/p>\n<p><span style=\"font-weight: 400;\">function<\/span> <span style=\"font-weight: 400;\">setupInsta<\/span><span style=\"font-weight: 400;\">(){<\/span><\/p>\n<p><span style=\"font-weight: 400;\">let<\/span><span style=\"font-weight: 400;\"> appId <\/span><span style=\"font-weight: 400;\">=<\/span> <span style=\"font-weight: 400;\">&#8220;XXXXXXXXXXXXXX&#8221;<\/span><span style=\"font-weight: 400;\">;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">let<\/span><span style=\"font-weight: 400;\"> redUri <\/span><span style=\"font-weight: 400;\">=<\/span> <span style=\"font-weight: 400;\">window<\/span><span style=\"font-weight: 400;\">.<\/span><span style=\"font-weight: 400;\">location<\/span><span style=\"font-weight: 400;\">.<\/span><span style=\"font-weight: 400;\">origin<\/span> <span style=\"font-weight: 400;\">+<\/span> <span style=\"font-weight: 400;\">&#8220;\/insta&#8221;<\/span><span style=\"font-weight: 400;\">;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">let<\/span><span style=\"font-weight: 400;\"> url <\/span><span style=\"font-weight: 400;\">=<\/span> <span style=\"font-weight: 400;\">`https:\/\/api.instagram.com\/oauth\/authorize?client_id=<\/span><span style=\"font-weight: 400;\">${appId}<\/span><span style=\"font-weight: 400;\">&amp;redirect_uri=<\/span><span style=\"font-weight: 400;\">${redUri}<\/span><span style=\"font-weight: 400;\">&amp;scope=user_profile,user_media&amp;response_type=code`<\/span><span style=\"font-weight: 400;\">;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">window<\/span><span style=\"font-weight: 400;\">.<\/span><span style=\"font-weight: 400;\">open<\/span><span style=\"font-weight: 400;\">(url, <\/span><span style=\"font-weight: 400;\">&#8220;_blank&#8221;<\/span><span style=\"font-weight: 400;\">).<\/span><span style=\"font-weight: 400;\">focus<\/span><span style=\"font-weight: 400;\">();<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">It will open authorization window on a new tab. After being authorized it will redirect to\u00a0<\/span><span style=\"font-weight: 400;\">\/insta<\/span><span style=\"font-weight: 400;\">\u00a0page(as configured on the above code) with a query parameter containing\u00a0<\/span><span style=\"font-weight: 400;\">code<\/span><span style=\"font-weight: 400;\">. That code will be used to fetch short-lived access token on the backend.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Next, the\u00a0<\/span><span style=\"font-weight: 400;\">code<\/span><span style=\"font-weight: 400;\">\u00a0&amp;\u00a0<\/span><span style=\"font-weight: 400;\">redirect URI<\/span><span style=\"font-weight: 400;\">\u00a0are sent to the server for further processing.<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">axios.<\/span><span style=\"font-weight: 400;\">post<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">&#8220;https:\/\/your-server-url\/init-insta&#8221;<\/span><span style=\"font-weight: 400;\">, {<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">code<\/span><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">&#8216;code-query-param-from-url&#8217;<\/span><span style=\"font-weight: 400;\">,<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">redirectUrl<\/span><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">&#8216;redirect-url&#8217;<\/span> <span style=\"font-weight: 400;\">\/\/ needs to be registered at fb developer console<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">})<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">.<\/span><span style=\"font-weight: 400;\">then<\/span><span style=\"font-weight: 400;\">(({ data }) <\/span><span style=\"font-weight: 400;\">=&gt;<\/span><span style=\"font-weight: 400;\"> {<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\">\/\/ handle success case<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">})<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Backend<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">It\u2019s assumed that the backend has an endpoint for receiving\u00a0<\/span><span style=\"font-weight: 400;\">code<\/span><span style=\"font-weight: 400;\">\u00a0&amp;\u00a0<\/span><span style=\"font-weight: 400;\">redirect URI<\/span><span style=\"font-weight: 400;\">\u00a0via any HTTP method.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now, the next step is to get Short-Lived-Access-Token. The code is self-explanatory.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">JSON-based POST won\u2019t work. So form based request is sent via\u00a0<\/span><b>request<\/b><span style=\"font-weight: 400;\">.<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">\/ data from frontend<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">let code = req.body.code;<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">let redirectUri = req.body.redirectUri;<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">let accessToken = null;<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">try {<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0 \u00a0 \/\/ send form based request to Instagram API<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0 \u00a0 let result = await request.post({<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 url: &#8216;https:\/\/api.instagram.com\/oauth\/access_token&#8217;,<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 form: {<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 client_id: process.env.INSTA_APP_ID,<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 client_secret: process.env.INSTA_APP_SECRET,<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 grant_type: &#8216;authorization_code&#8217;,<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 redirect_uri: req.body.redirectUri,<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 code: req.body.code<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 }<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0 \u00a0 });<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0 \u00a0 \/\/ Got access token. Parse string response to JSON<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0 \u00a0 accessToken = JSON.parse(result).access_token;<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">} catch (e) {<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0 \u00a0 console.log(&#8220;Error=====&#8221;, e);<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">}<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>After\u00a0<\/b><span style=\"font-weight: 400;\">Short-Lived-Access-<\/span><b>Token<\/b><span style=\"font-weight: 400;\">\u00a0is obtained, it needs to be exchanged with<\/span><b>\u00a0<\/b><span style=\"font-weight: 400;\">Long-Lived-Access-Token.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">try {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0let resp = await axios.get(`https:\/\/graph.instagram.com\/access_token?grant_type=ig_exchange_token&amp;client_secret=${process.env.INSTA_APP_SECRET}&amp;access_token=${accessToken}`)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0accessToken = resp.data.access_token;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\/\/ save accessToken\u00a0 to Database<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0} catch (e) {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0console.log(&#8220;Error=====&#8221;, e.data);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">For further API calls only the\u00a0<\/span><b>Long-Lived-Access-Token<\/b><span style=\"font-weight: 400;\">\u00a0is used. As mentioned earlier, short-lived token has 1 hour validity. Similarly long-lived token has 60 days validity. i.e. the token just stored on DB needs to be refreshed before it expires.<\/span><\/p>\n<p><strong>3. Setup Token Refresh Service<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">To refresh token every 60 days, a cron job seems suitable.\u00a0<\/span><a href=\"https:\/\/www.npmjs.com\/package\/node-cron\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">node-cron<\/span><\/a><span style=\"font-weight: 400;\">\u00a0will serve best for this purpose.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">import cron from &#8216;node-cron&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">import instaRefreshCron from &#8220;.\/crons\/instaRefresh.cron&#8221;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\/\/ run immediately after server starts<\/span><\/p>\n<p><span style=\"font-weight: 400;\">instaRefreshCron();<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\/\/ refresh instaAccessToken eg: weekly(every Sat)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">cron.schedule(&#8216;* * * * * 7&#8217;, async () =&gt; {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0await instaRefreshCron();<\/span><\/p>\n<p><span style=\"font-weight: 400;\">});<\/span><\/p>\n<p><strong>4. Fetch data\u00a0<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Finally, its time to fetch data from Instagram. We will be making use of the\u00a0<\/span><span style=\"font-weight: 400;\">accessToken<\/span><span style=\"font-weight: 400;\">\u00a0stored on DB. To learn more on what kinds of data can be fetched, visit this\u00a0<\/span><a href=\"https:\/\/developers.facebook.com\/docs\/instagram-basic-display-api\/guides\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">page<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">try {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0let instaAccessToken = &#8220;XXXXXX&#8221;; \/\/ get from DB<\/span><\/p>\n<p><span style=\"font-weight: 400;\">let resp = await axios.get(`https:\/\/graph.instagram.com\/me\/media?fields=media_type,permalink,media_url&amp;access_token=${instaAccessToken}`);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0resp = resp.data;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0let instaPhotos = resp.data.filter(d =&gt; d.media_type === &#8220;IMAGE&#8221;).map(d =&gt; d.media_url);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\/\/ Got insta photos<\/span><\/p>\n<p><span style=\"font-weight: 400;\">} catch (e) {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0console.log(e.response.data.error);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<h3><b>How to use iOS <\/b><b>Instagram<\/b><b>\u00a0API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Before you learn how to use iOS API you need to create : Facebook Developer Account.<\/span><\/p>\n<p><strong>Step1: Create a Facebook App<\/strong><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Go to the developer.facebook.com , click on My app to create a new app. After creating the app and are in the app navigation board, go to the Setting&gt; Basic and sroll to the bottom of the page and Click on Add Platform.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Choose iOS and add your iOS Bundle and shared secret, and save your changes.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To get your BundleID just click on your project in Xcode, select your Target, then click on General, you will find your Bundle ID in Identity&gt;Display Name.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To get Shared Secret copy your App Secret and paste it in the Shared Secret.\u00a0<\/span><\/li>\n<\/ul>\n<p><strong>Step2: Configure Instagram\u00a0 Basic Display<\/strong><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click Products, locate the Instagram product, and click Set up tp add to your app.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click Basic Display and go to the bottom of the page and Click Create New App. Now enter the name of the app you created.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Next in Valid OAuth Redirect URIs, enter your website\u2019s URL or any other website\u2019s URL. Normally this would be a dedicated URI that can capture redirect query string parameters. Save the URL since you will be needing it later. <\/span><span style=\"font-weight: 400;\">In Deauthorize Callback URL, enter the copied URL again. Eventually you will have to change this to a URL that can handle deauthorization notifications, but for the purposes of this tutorial, you can re-use the above copied URL.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Do the same forData Deletion Request Callback URL.<\/span><\/li>\n<\/ul>\n<p><strong>Step3: Add an Instagram Test User<\/strong><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Navigate to\u00a0Roles<\/span><b>\u00a0<\/b><span style=\"font-weight: 400;\">&gt;<\/span><b>\u00a0<\/b><span style=\"font-weight: 400;\">Roles\u00a0and scroll down to the\u00a0Instagram Testers\u00a0section. Click\u00a0Add Instagram Testers\u00a0and enter your Instagram account\u2019s username and send the invitation<\/span><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Open a new web browser and go to <a href=\"http:\/\/www.instagram.com\/\" target=\"_blank\" rel=\"noopener\">instagram<\/a><\/span><span style=\"font-weight: 400;\">\u00a0and sign into your Instagram account that you just invited. Navigate to\u00a0(Profile Icon) &gt; Edit Profile &gt; Apps and Websites &gt; Tester Invites<\/span><b>\u00a0<\/b><span style=\"font-weight: 400;\">and accept the invitation.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Your Instagram account is now eligible to be accessed by your Facebook app while it is in Development Mode.<\/span><\/p>\n<h2><b>Instagram\u00a0API cost<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">A common question asked by developers, is Instagram API free. There is no cost associated with using Instagram API but you need to first apply and be granted access by Instagram. To get access to Instagram API, first create a developer\u2019s account and submit your app for review. Instagram has strict policy guidelines that your app needs to follow to get access. After gaining access API you can use it for free as per the rate limit. You can always upgrade your plan to match the scale of your operation. Instagram API pricing offered by Rapid API is as follows.\u00a0<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">Model<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Requests<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Rate<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Basic ($0.00)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">10\/day<\/span><\/td>\n<td><span style=\"font-weight: 400;\">3 requests per minute<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Pro ($5.00\/month)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">200\/day<\/span><\/td>\n<td><span style=\"font-weight: 400;\">5 requests per minute<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Ultra ($10.00\/month)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">500\/day<\/span><\/td>\n<td><span style=\"font-weight: 400;\">10 requests per minute<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Mega ($100.00\/month)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">6,000\/day<\/span><\/td>\n<td><span style=\"font-weight: 400;\">25 requests per minute<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><\/h2>\n<h2><strong>Most used\u00a0Instagram\u00a0APIs<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">The most popular Instagram APIs are given below:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Instagram Graph API<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Instagram Basic Display API<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Instagram Messaging API<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Sharing to Stories<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Embedding<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Instagram\u00a0graph API<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The API allows you to manage your account, publish content, and access some public data from Instagram, but only a subset of features is available compared to Instagram&#8217;s official applications.<\/span><\/p>\n<h3><b>Instagram\u00a0username availability API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The Instagram username availability API is a free tool that allows users to check if an Instagram name can be used. This is a great tool to businesses or individuals looking to establish their Instagram presence. The results are instantaneous\u00a0\u00a0<\/span><\/p>\n<h3><b>Instagram<\/b><b>\u00a0reels API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The Instagram\u00a0reels API will allow developers to interact with Reels on Instagram. The API supports content publishing, insights, comment moderation, hashtag search, business discovery, mentions, promote API, and Instagram basic display API.\u00a0<\/span><\/p>\n<h3><b>Instagram\u00a0API get followers<\/b><\/h3>\n<p><span style=\"font-weight: 400;\"><a href=\"https:\/\/unremot.com\/category\/instagram-api\">Instagram API<\/a> get followers is a fast way to influence you need on Instagram. The INS Followers is one of the APIs you can use to get real Instagram followers. The platform allows you to get real Instagram users.\u00a0<\/span><\/p>\n<h3><b>Instagram\u00a0feed API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The Instagram Basic Display API allows\u00a0 users of your App to get basic profile information, videos, and photos in their Instagram account. The API is used to access to any type of Instagram account.<\/span><\/p>\n<h3><b>Instagram<\/b><b>\u00a0post API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The Instagram Content Publishing API images, videos, and reels on your Instagram Business Account. The API was changed in the beginning of 2023. However Instagram Creator accounts was not supported<\/span><\/p>\n<h3><b>Instagram<\/b><b>\u00a0messenger API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Instagram messenger API\u00a0 offers personal connections at every phase in the marketing journey. Brands can communicate with their customers on their preferred channel. The tool allows for integration with existing tools and data and lets business manage high volume of data.\u00a0<\/span><\/p>\n<h3><b>Instagram<\/b><b>\u00a0insights API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">You may get information about your Instagram account, including your follower count, reach, and engagement, by using the Instagram analytics API. You may use this information to keep tabs on how well your account is performing and to plan your content strategy.<\/span><\/p>\n<h3><b>Instagram<\/b><b>\u00a0stories API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The Instagram Stories API allows you to integrate and share stories with your iOS or android apps.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Instagram\u00a0ads API<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Instagram\u00a0share API<\/span><\/p>\n<h3><b>Instagram<\/b><b>\u00a0login API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Instagram login API allow users to log in to your account using their Instagram account. This is useful incase users want to share their Instagram stories or follow other Instagram users.\u00a0<\/span><\/p>\n<h3><b>Instagram\u00a0hashtag API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Inflact is an Instagram hashtag API. You can use Inflact&#8217;s Hashtag Generator to create hashtags for your social media easily. Use the data retrieved from the API to come up with countless pertinent ideas. Inflact uses the Hashtag Search functionality in the Instagram Graph API<\/span><\/p>\n<h3><b>Instagram\u00a0analytics API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">There are Instagram analytics API like Minter.io that provides data about Instagram performance metrics. You can use the API to\u00a0 create easily report using analytics data output to a variety of interfaces. Minter.io uses Insights functionality in the Instagram Graph API.<\/span><\/p>\n<h3><b>Instagram\u00a0mentions API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Instagram mentions API allows you to retrieve all the mentions that users have received in comments and captions. However there are some limitations\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Mentions on stories not supported.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Commenting on phots where you tagged are not supported.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">@mention appears was created by an account set to private.\u00a0<\/span><\/li>\n<\/ul>\n<h3><b>Instagram<\/b><b>\u00a0live API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Instagram live API represents a collection of live video IG Media or an IG User. You can get a collection of live video on IG Media on an IG user. You can make requests to the API to start, stop, and manage the live video. The only limitation being only live video IG Media being broadcast at the time of the request will be returned.<\/span><\/p>\n<h3><b>Instagram<\/b><b>\u00a0images API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The Instagram Images API is a RESTful API that allows you to retrieve images from Instagram. You can use this API to get information about a specific image, such as its caption, location, and media, or you can get information about all the images from a specific user or hashtag.<\/span><\/p>\n<h3><b>Instagram\u00a0demographics API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Instagram demographics API\u00a0 represents social media metrics on Instagram users. It allows businesses to access demographic information about their users. They can use the information to create more targeted marketing campaign.\u00a0<\/span><\/p>\n<h3><b>Instagram\u00a0marketing API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The Meta marketing API are a collection of Graph API endpoints that can be used to advertise on Facebook and Instagram. The Instagram marketing API can be used by businesses of all the users to reach a wider audience and improve their advertising campaigns.\u00a0<\/span><\/p>\n<h3><b>Instagram\u00a0download API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Instagram download API allows you to download images and captions. This is useful if you want to save photographs and captions for offline viewing or personal collections of Instagram content or sharing photos and videos. There several Instagram download API some are free and some free.\u00a0\u00a0<\/span><\/p>\n<h3><b>Instagram<\/b><b>\u00a0embed API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Instagram embed API allows you post your Instagram username and link to your profile along with your content or profile. Remember the account must be public and the embedded settings must be turned on. Private accounts and content cannot be embedded.\u00a0\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article will discuss about how to use Instagram API with step-by-step integration guide and full documentation list. Let&#8217;s get started! Overview of\u00a0Instagram\u00a0API Instagram is a photo and video-sharing platform and is one of the leading social media platforms in the world with over 1 billion people using the app every month. Instagram API for [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":5254,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[76],"tags":[],"class_list":{"0":"post-5250","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-technology","8":"entry"},"_links":{"self":[{"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/posts\/5250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/comments?post=5250"}],"version-history":[{"count":7,"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/posts\/5250\/revisions"}],"predecessor-version":[{"id":5259,"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/posts\/5250\/revisions\/5259"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/media\/5254"}],"wp:attachment":[{"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/media?parent=5250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/categories?post=5250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/tags?post=5250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}