{"id":30358755,"url":"https://github.com/appit-online/ionic-insta-api-wrapper","last_synced_at":"2025-10-14T04:35:54.721Z","repository":{"id":306842607,"uuid":"1027201127","full_name":"appit-online/ionic-insta-api-wrapper","owner":"appit-online","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-08T20:04:26.000Z","size":281,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-10T13:58:31.726Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appit-online.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-27T14:28:24.000Z","updated_at":"2025-10-08T20:04:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"1bf565e7-2d17-408d-8b0d-dd8e5f621601","html_url":"https://github.com/appit-online/ionic-insta-api-wrapper","commit_stats":null,"previous_names":["appit-online/ionic-insta-story-search","appit-online/ionic-insta-api-wrapper"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/appit-online/ionic-insta-api-wrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appit-online%2Fionic-insta-api-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appit-online%2Fionic-insta-api-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appit-online%2Fionic-insta-api-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appit-online%2Fionic-insta-api-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appit-online","download_url":"https://codeload.github.com/appit-online/ionic-insta-api-wrapper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appit-online%2Fionic-insta-api-wrapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017934,"owners_count":26086213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-19T11:02:32.241Z","updated_at":"2025-10-14T04:35:54.708Z","avatar_url":"https://github.com/appit-online.png","language":"TypeScript","readme":"# [ionic-insta-api-wrapper: Ionic](https://github.com/appit-online/ionic-insta-api-wrapper)\n\nA lightweight library to **fetch Instagram Stories, Reels, Highlights, user details, profiles, posts...**, including login and cookie handling — built for use in **Ionic** and **Cordova** environments with native HTTP support.\n\n---\n\n## 🚀 Features\n\n- 🔐 Login and fetch session cookie or auth token via `getCookie` or `login` / `login2FA`\n- 🍪 Save \u0026 reuse sessions\n- 📖 `InstaService.getStories` – Fetch Instagram stories\n- 📦 `InstaService.fetchTrayStories` – Fetch all stories in the user's tray\n- 🌟 `InstaService.getHighlights` – Fetch Instagram highlights for a user\n- 👤 `InstaService.getUIdByUsername` – Get the user ID by username\n- 📝 `InstaService.getUserDetails` – Fetch detailed user information\n- 📷 `InstaService.fetchUserProfilePosts` – Fetch posts from a user's profile\n- 🖼️ `InstaService.fetchUserPostsByUserId` – Fetch posts by user ID\n- 🔗 `InstaService.fetchContentByUrl` – Fetch content from a post URL\n- ✂️ `InstaService.fetchContentByShortCode` – Fetch content using Instagram shortcode\n- 🆔 `InstaService.fetchContentByMediaId` – Fetch content by media ID\n- ➕ `InstaService.follow` – Follow a user by username or user ID\n- ❤️ `InstaService.like` – Like a post by media ID\n---\n\n**Table of contents:**\n\n* [Quickstart](#quickstart)\n\n  * [Installing the library](#installation)\n  * [Using the library](#using-the-library)\n* [License](#license)\n\n## Quickstart\n\n\n## 📦 Installation\n\n```bash\nnpm install ionic-insta-api-wrapper\n\nionic cordova plugin add cordova-plugin-advanced-http\nnpm install ionic-insta-api-wrapper --save\n```\n\n### Using the library\n\n### Cookie-based Authentication - Beta\n```javascript\nimport * as instaStory from 'ionic-insta-api-wrapper';\n\nconst username = 'your_instagram_username';\nconst password = 'your_instagram_password';\n\n// 🔐 Get Instagram session cookie (with optional force refetch)\nconst refetchCookie = true;\nconst userDetails = await instaStory.getCookie(username, password, refetchCookie);\n\n// 💾 Save cookie \u0026 expiration for reuse\nlocalStorage.setItem('cookie', userDetails.cookie);\nlocalStorage.setItem('expires', userDetails.expires);\n\n// 📲 Initialize InstaService with your session cookie\nconst igService = new instaStory.InstaService(userDetails.cookie);\n```\n\n### Token Authentication\n```javascript\nimport * as instaStory from 'ionic-insta-api-wrapper';\n\nconst username = 'your_instagram_username';\nconst password = 'your_instagram_password';\n\n// 🔐 Get Instagram auth token\nlet userDetails: any;\nlet loginService = new instaStory.LoginService();\nconst reqHeaders = {\n  'User-Agent': 'Instagram 177.0.0.30.119 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)',\n}\n\ntry {\n  userDetails = await loginService.login(username, password, reqHeaders);\n}catch(e: any) {\n  const parsed = JSON.parse(e);\n  if (parsed.two_factor_required) {\n    // 2FA required\n    const info = parsed.two_factor_info;\n    userDetails = await loginService.login2FA(password, twoFactorAppCode, twoFactorIdentifier, username, reqHeaders);\n  }\n}\n\n// 💾 Save userDetails for reuse\nlocalStorage.setItem('userDetails', userDetails);\n\n// 📲 Initialize InstaService\nconst igService = new instaStory.InstaService();\n```\n\n```javascript\n\n/**\n * Get insta story tray\n * @param {string} request headers @optional - required for token authentication\n */\n // 📲 Initialize InstaService\nconst igService = new instaStory.InstaService();\n\nconst requestHeaders = {\n  'Authorization':userDetails.headers[\"ig-set-authorization\"],\n  \"Ig-U-Ds-User-Id\": userDetails.headers[\"ig-set-ig-u-ds-user-id\"],\n  \"Ig-U-Rur\": userDetails.headers[\"ig-set-ig-u-rur\"],\n  \"X-Ig-Www-Claim\": userDetails.headers[\"x-ig-set-www-claim\"],\n  'User-Agent': 'Instagram 177.0.0.30.119 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)',\n}\n\n// 📖 Fetch Instagram Tray Stories\nconst storyTray = await igService.fetchTrayStories(requestHeaders);\nconsole.log(storyTray);\n[\n  {\n  \"id\": \"21335\",\n  \"full_name\": \"Yoga Instructor\",\n  \"username\": \"mrstest\",\n  \"story_duration_secs\": 5,\n  \"media_count\": 4,\n  \"has_video\": true,\n  \"profile_pic_url\": \"https://scontent-muc2-1.cdninstagram.com/v/5770385_n.jpg\",\n  \"is_verified\": false,\n  \"is_private\": false\n  },\n  ...\n]\n```\n\n```javascript\n\n/**\n * Get insta stories\n * @param {string} username value\n * @param {boolean} export insta response @optional - include raw GraphQL data\n * @param {string} request headers @optional - required for token authentication\n */\n// 📖 Fetch Instagram Stories\ntry {\n  const requestHeaders = {\n    'Authorization':userDetails.headers[\"ig-set-authorization\"],\n    \"Ig-U-Ds-User-Id\": userDetails.headers[\"ig-set-ig-u-ds-user-id\"],\n    \"Ig-U-Rur\": userDetails.headers[\"ig-set-ig-u-rur\"],\n    \"X-Ig-Www-Claim\": userDetails.headers[\"x-ig-set-www-claim\"],\n    'User-Agent': 'Instagram 177.0.0.30.119 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)',\n  }\n\n  const stories = await igService.getStories('someuser', true, requestHeaders);\n  console.log(stories);\n} catch (error: any) {\n  if (error.message === 'private profile') {\n    console.warn('The user profile is private and stories cannot be accessed.');\n  } else {\n    console.error('Unknown error:', error);\n  }\n}\n\n{\n   \"id\": \"123008993\",\n   \"username\": \"someusername\",\n   \"name\": \"User Name\", \n   \"profilePicture\": \"https://scontent-muc2-1.cdninstagram.com/v/t51.2885-19/403891526_89150552568277163_n.jpg\",\n   \"stories_count\": 10,\n   \"media\": [\n    {\n      \"id\": \"36999034226_191008993\",\n      \"taken_at\": 1755282929,\n      \"expiring_at\": 1755369329,\n      \"original_width\": 640,\n      \"original_height\": 1136,\n      \"caption\": null,\n      \"thumbnail\": \"https://scontent-muc2-1.cdninstagram.com/v/t51.2885-15/533658976_73414557283417579416565_n.jpg\",\n      \"thumbnailDefault\": \"https://scontent-muc2-1.cdninstagram.com/v/t51.2885-15/53365897678818856079416565_n.jpg\",\n      \"type\": \"video\",\n      \"mimetype\": \"video/mp4\",\n      \"url\": \"https://scontent-muc2-1.cdninstagram.com/o1/v/t2/f2/m78/AQOcKHtdfCkfdfJ5XMY96xY4_IiwMQ7vvgM9U1Yo-lcutWgH9AfdDbofL1f8Y13r7g647Gk.mp4\",\n      \"has_audio\": true,\n      \"video_duration\": 4.77\n    },\n    {\n      \"id\": \"369972572609_191008993\",\n      \"taken_at\": 1755261686,\n      \"expiring_at\": 1755348086,\n      \"original_width\": 1179,\n      \"original_height\": 2096,\n      \"caption\": null,\n      \"thumbnail\": \"https://scontent-muc2-1.cdninstagram.com/v/t51.2885-15/5331086517083875_n.jpg\",\n      \"thumbnailDefault\": \"https://scontent-muc2-1.cdninstagram.com/v/t51.2885-15/533108886_701523226517083875_n.jpg\",\n      \"type\": \"image\",\n      \"mimetype\": \"image/jpeg\",\n      \"url\": \"https://scontent-muc2-1.cdninstagram.com/v/t51.2885-15/533108886_18525701523226517083875_n.jpg\",\n      \"has_audio\": false,\n      \"video_duration\": 0\n    },\n        ...\n  ]\n}\n```\n\n```javascript\n\n/**\n * Get profile highlights\n * @param {string} username value\n * @param {string} request headers @optional - required for token authentication\n */\ntry {\n  const reqHeaders = {}\n  const stories = await igService.getHighlights('someuser', reqHeaders);\n  console.log(stories);\n} catch (error: any) {\n  console.error('Unknown error:', error);\n}\n\n{\n  \"last_paginated_highlights_node_edited_at_ts\": null,\n  \"has_fetched_all_remaining_highlights\": null,\n  \"suggested_highlights\": {},\n  \"cursor\": null,\n  \"highlights_tray_type\": \"DEFAULT\",\n  \"my_week_enabled\": null,\n  \"status\": \"ok\",\n  \"tray\": [\n  {\n    \"id\": \"highlight:1234567890\",\n    \"reel_type\": \"highlight_reel\",\n    \"title\": \"Mein Highlight\",\n    \"created_at\": 1700000000,\n    \"is_pinned_highlight\": false,\n    \"prefetch_count\": 0,\n    \"disabled_reply_types\": [\n      \"story_remix_reply\",\n      \"story_selfie_reply\"\n    ],\n    \"highlight_reel_type\": \"DEFAULT\",\n    \"is_converted_to_clips\": false,\n    \"is_nux\": false,\n    \"can_gif_quick_reply\": true,\n    \"can_reshare\": false,\n    \"is_archived\": false,\n    \"strong_id__\": \"highlight:1234567890\",\n    \"cover_media\": {\n      \"crop_rect\": [0.1, 0.1, 0.9, 0.9],\n      \"media_id\": \"9876543210_123456789\",\n      \"upload_id\": null,\n      \"cropped_image_version\": {\n        \"height\": 150,\n        \"scans_profile\": \"\",\n        \"url\": \"https://example.com/cropped_image.jpg\",\n        \"width\": 150\n      },\n      \"full_image_version\": null\n    },\n    \"ranked_position\": -1000,\n    \"seen_ranked_position\": -1000,\n    \"media_count\": 10,\n    \"updated_timestamp\": 1700001000,\n    \"latest_reel_media\": 1700000500,\n    \"seen\": null,\n    \"can_reply\": true,\n    \"can_react_with_avatar\": false,\n    \"contains_stitched_media_blocked_by_rm\": false,\n    \"user\": {\n      \"pk\": \"123456789\",\n      \"full_name\": \"Max Mustermann\",\n      \"pk_id\": \"123456789\",\n      \"id\": \"123456789\",\n      \"strong_id__\": \"123456789\",\n      \"username\": \"max123\",\n      \"is_private\": false,\n      \"is_verified\": false,\n      \"profile_pic_id\": \"1111111111_123456789\",\n      \"profile_pic_url\": \"https://example.com/profile_pic.jpg\",\n      \"account_badges\": [],\n      \"interop_messaging_user_fbid\": 999999999999,\n      \"is_creator_agent_enabled\": false\n    }\n  }\n]\n}\n\n\n````\n\n```javascript\n/**\n * Get insta userId\n * @param {string} username value\n * @param {string} request headers @optional \n */\n// 📖 Fetch Instagram UserId\ntry {\n  const reqHeaders = {}\n  const uid = await igService.getUIdByUsername('someuser', reqHeaders); \n  console.log(uid);\n} catch (error: any) {\n  console.error('Unknown error:', error);\n}\n\n\n/**\n * Get insta profile\n * @param {string} username value\n * @param {string} request headers @optional\n */\ntry {\n  const reqHeaders = {}\n  const profile = await igService.getUserDetails('someuser', reqHeaders);\n  console.log(profile);\n} catch (error: any) {\n  console.error('Unknown error:', error);\n}\n\n{\n  \"ai_agent_type\": null,\n  \"biography\": \"Example biography with some emojis and mentions like @exampleuser.\",\n  \"bio_links\": [\n    {\n      \"title\": \"\",\n      \"lynx_url\": \"https://l.instagram.com/?u=http%3A%2F%2Fexample.com%2Fprofile\u0026e=AT123456789\",\n      \"url\": \"http://example.com/profile\",\n      \"link_type\": \"external\"\n    }\n  ],\n  \"fb_profile_biolink\": null,\n   \"biography_with_entities\": {\n      \"raw_text\": \"Example biography with @users and #hashtags\",\n      \"entities\": [\n        {\n          \"user\": {\n            \"username\": \"exampleuser\"\n          },\n          \"hashtag\": null\n        }\n      ]\n  },\n  \"blocked_by_viewer\": false,\n  \"restricted_by_viewer\": false,\n  \"country_block\": false,\n  \"eimu_id\": \"1234567890\",\n  \"external_url\": \"http://example.com\",\n  \"external_url_linkshimmed\": \"https://l.instagram.com/?u=http%3A%2F%2Fexample.com\u0026e=AT123456789\",\n  \"edge_followed_by\": {\n    \"count\": 12345\n  },\n  \"fbid\": \"17840000000000000\",\n  \"followed_by_viewer\": true,\n  \"edge_follow\": {\n    \"count\": 150\n  },\n  \"follows_viewer\": false,\n  \"full_name\": \"Example Name\",\n  \"group_metadata\": null,\n  \"has_ar_effects\": false,\n  \"has_clips\": true,\n  \"has_guides\": false,\n  \"has_chaining\": true,\n  \"has_channel\": false,\n  \"has_blocked_viewer\": false,\n  \"highlight_reel_count\": 5,\n  \"has_requested_viewer\": false,\n  \"hide_like_and_view_counts\": false,\n  \"id\": \"123456789\",\n  \"is_business_account\": false,\n  \"is_professional_account\": true,\n  \"is_supervision_enabled\": false,\n  \"is_guardian_of_viewer\": false,\n  \"is_supervised_by_viewer\": false,\n  \"is_supervised_user\": false,\n  \"is_embeds_disabled\": false,\n  \"is_joined_recently\": false,\n  \"guardian_id\": null,\n  \"business_address_json\": null,\n  \"business_contact_method\": \"UNKNOWN\",\n  \"business_email\": null,\n  \"business_phone_number\": null,\n  \"business_category_name\": null,\n  \"overall_category_name\": null,\n  \"category_enum\": null,\n  \"category_name\": \"Public Figure\",\n  \"is_private\": false,\n  \"is_verified\": true,\n  \"is_verified_by_mv4b\": false,\n  \"is_regulated_c18\": false,\n  \"edge_mutual_followed_by\": {\n    \"count\": 0,\n    \"edges\": []\n  },\n  \"pinned_channels_list_count\": 0,\n  \"profile_pic_url\": \"https://example.com/profile.jpg\",\n  \"profile_pic_url_hd\": \"https://example.com/profile_hd.jpg\",\n  \"requested_by_viewer\": false,\n  \"should_show_category\": true,\n  \"should_show_public_contacts\": false,\n  \"show_account_transparency_details\": true,\n  \"transparency_label\": null,\n  \"transparency_product\": null,\n  \"username\": \"exampleuser\",\n  \"pronouns\": [],\n  \"edge_owner_to_timeline_media\": {\n      \"count\": 100,\n      \"page_info\": {\n        \"has_next_page\": true,\n        \"end_cursor\": \"\"\n      },\n      \"edges\": []\n  }\n}\n```\n\n```javascript\n/**\n * Get insta posts from user profile\n * @param {string} username value\n * @param {string} maxId - pagination of user posts - use response attribute next_max_id for more posts\n * @param {string} request headers @optional\n */\ntry {\n  const reqHeaders = {}\n  const profile = await igService.fetchUserProfilePosts('someuser', '', reqHeaders);\n  console.log(profile);\n} catch (error: any) {\n  console.error('Unknown error:', error);\n}\n\ntry {\n  const reqHeaders = {}\n  const profile = await igService.fetchUserPostsByUserId('190008993', '', reqHeaders);\n  console.log(profile);\n} catch (error: any) {\n  console.error('Unknown error:', error);\n}\n\n{\n  \"id\": \"123455\",\n  \"username\": \"username\",\n  \"name\": \"User Name\",\n  \"is_private\": false,\n  \"is_verified\": true,\n  \"profile_pic_url\": \"https://scontent-muc2-1.cdninstagram.com/v/t51.2885-19/403891521097167925951577163_n.jpg\",\n  \"more_available\": true,\n  \"next_max_id\": \"3696312669046_13753680437\",\n  \"media\": [\n  {\n    \"like_and_view_counts_disabled\": false,\n    \"has_privately_liked\": false,\n    \"is_post_live_clips_media\": false,\n    \"is_quiet_post\": false,\n    \"taken_at\": 1755342216,\n    \"has_tagged_users\": false,\n    \"media_type\": 2,\n    \"code\": \"DUMMYCODE123\",\n    \"caption\": {\n      \"text\": \"🔥 Beispieltext 🔥\\n\\nHier steht ein Dummy-Beitrag mit Hashtags und Emojis. 🏆\\n\\n#Beispiel #Dummy #Test\"\n    },\n    \"play_count\": 12345,\n    \"has_views_fetching\": true,\n    \"ig_play_count\": 12345,\n    \"image_versions2\": {\n      \"candidates\": [\n        {\n          \"height\": 1920,\n          \"width\": 1080,\n          \"url\": \"https://example.com/image_1080.jpg\"\n        },\n        {\n          \"height\": 1333,\n          \"width\": 750,\n          \"url\": \"https://example.com/image_750.jpg\"\n        },\n        {\n          \"height\": 1137,\n          \"width\": 640,\n          \"url\": \"https://example.com/image_640.jpg\"\n        },\n        {\n          \"height\": 853,\n          \"width\": 480,\n          \"url\": \"https://example.com/image_480.jpg\"\n        },\n        {\n          \"height\": 568,\n          \"width\": 320,\n          \"url\": \"https://example.com/image_320.jpg\"\n        }\n      ]\n    }\n  },...\n```\n\n```javascript\n\n/**\n * Get post, reel... by url\n * @param {string} url \n * @param {string} request headers @optional - required for token authentication\n */\ntry {\n  const requestHeaders = {\n    'Authorization':userDetails.headers[\"ig-set-authorization\"],\n    \"Ig-U-Ds-User-Id\": userDetails.headers[\"ig-set-ig-u-ds-user-id\"],\n    \"Ig-U-Rur\": userDetails.headers[\"ig-set-ig-u-rur\"],\n    \"X-Ig-Www-Claim\": userDetails.headers[\"x-ig-set-www-claim\"],\n    'User-Agent': 'Instagram 177.0.0.30.119 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)',\n  }\n  \n  const post = await igService.fetchContentByUrl('https://www.instagram.com/p/DM777IJO7rd/?igsh=MWM2ejl2Mm8zcWRtcg==', requestHeaders); \n  console.log(post);\n} catch (error: any) {\n  console.error('Unknown error:', error);\n}\n\n/**\n * Get post by shortCode\n * @param {string} shortCode\n * @param {string} request headers @optional - required for token authentication\n */\ntry {\n  const requestHeaders = {\n    'Authorization':userDetails.headers[\"ig-set-authorization\"],\n    \"Ig-U-Ds-User-Id\": userDetails.headers[\"ig-set-ig-u-ds-user-id\"],\n    \"Ig-U-Rur\": userDetails.headers[\"ig-set-ig-u-rur\"],\n    \"X-Ig-Www-Claim\": userDetails.headers[\"x-ig-set-www-claim\"],\n    'User-Agent': 'Instagram 177.0.0.30.119 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)',\n  }\n\n  const post = await igService.fetchContentByShortCode('AU7s3IJO7rd', requestHeaders);\n  console.log(post);\n} catch (error: any) {\n  console.error('Unknown error:', error);\n}\n\n{\n  \"username\": \"dummyuser\",\n  \"name\": \"Max Mustermann\",\n  \"postType\": \"p\",\n  \"media_id\": \"123456789012345678_9876543210\",\n  \"shortcode\": \"ABC123XYZ\",\n  \"createdAt\": 1700000000,\n  \"likes\": 42,\n  \"caption\": \"Hier ist ein Dummy-Beitrag mit Bild. 🌟🥳 #dummy #testpost\",\n  \"media_count\": 1,\n  \"comment_count\": 3,\n  \"video_duration\": 0,\n  \"music\": {},\n  \"media\": [\n    {\n      \"id\": \"123456789012345678_9876543210\",\n      \"thumbnail\": \"https://via.placeholder.com/1080x1350.png?text=Thumbnail\",\n      \"url\": \"https://via.placeholder.com/1080x1350.png?text=Full+Image\",\n      \"type\": \"image\",\n      \"dimensions\": {\n        \"height\": 1350,\n        \"width\": 1080\n      }\n    }\n  ]\n}\n```\n\n\n```javascript\n/**\n * Get post, highlight, reel by mediaId\n * @param {string} mediaId\n * @param {string} request headers @optional - required for token authentication\n */\ntry {\n  const requestHeaders = {\n    'Authorization':userDetails.headers[\"ig-set-authorization\"],\n    \"Ig-U-Ds-User-Id\": userDetails.headers[\"ig-set-ig-u-ds-user-id\"],\n    \"Ig-U-Rur\": userDetails.headers[\"ig-set-ig-u-rur\"],\n    \"X-Ig-Www-Claim\": userDetails.headers[\"x-ig-set-www-claim\"],\n    'User-Agent': 'Instagram 177.0.0.30.119 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)',\n  }\n\n  const post = await igService.fetchContentByMediaId('3691741226493_45705178442', requestHeaders);\n  console.log(post);\n} catch (error: any) {\n  console.error('Unknown error:', error);\n}\n\n{\n  \"username\": \"username\",\n  \"name\": \"Dummy Name\",\n  \"postType\": \"story\",\n  \"media_id\": \"369464054_458376602\",\n  \"shortcode\": \"DNFoF7y\",\n  \"createdAt\": 1754155492,\n  \"media\": [\n    {\n      \"like_and_view_counts_disabled\": false,\n      \"has_privately_liked\": false,\n      \"is_post_live_clips_media\": false,\n      \"is_quiet_post\": false,\n      \"taken_at\": 1754655492,\n      \"media_type\": 2,\n      \"code\": \"DUMMY_CODE_123\",\n      \"has_views_fetching\": true,\n      \"image_versions2\": {\n        \"candidates\": [\n          {\n            \"height\": 1136,\n            \"width\": 640,\n            \"url\": \"https://example.com/image1_1136x640.jpg\"\n          },\n          {\n            \"height\": 852,\n            \"width\": 480,\n            \"url\": \"https://example.com/image2_852x480.jpg\"\n          },\n          {\n            \"height\": 568,\n            \"width\": 320,\n            \"url\": \"https://example.com/image3_568x320.jpg\"\n          },\n          {\n            \"height\": 426,\n            \"width\": 240,\n            \"url\": \"https://example.com/image4_426x240.jpg\"\n          },\n          {\n            \"height\": 640,\n            \"width\": 640,\n            \"url\": \"https://example.com/image5_640x640.jpg\"\n          }\n        ]\n      }\n    }\n  ]\n}\n```\n\n\n``` javascript\n/**\n* Follow Account\n* @param {string} username or userId\n* @param {string} request headers @optional - required for token authentication\n*/\n  try {\n    const requestHeaders = {\n      'Authorization':userDetails.headers[\"ig-set-authorization\"],\n      \"Ig-U-Ds-User-Id\": userDetails.headers[\"ig-set-ig-u-ds-user-id\"],\n      \"Ig-U-Rur\": userDetails.headers[\"ig-set-ig-u-rur\"],\n      \"X-Ig-Www-Claim\": userDetails.headers[\"x-ig-set-www-claim\"],\n      'User-Agent': 'Instagram 177.0.0.30.119 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)',\n    }\n    \n    const followed = await igService.follow('usernameOrId', requestHeaders);\n    console.log(followed);\n  \n  } catch (error: any) {\n    console.error('Unknown error:', error);\n  }\n  \n   {\n     \"following\": true,\n     \"is_bestie\": false,\n     \"is_feed_favorite\": false,\n     \"is_private\": false,\n     \"is_restricted\": false,\n     \"incoming_request\": false,\n     \"outgoing_request\": false,\n     \"followed_by\": false,\n     \"muting\": false,\n     \"blocking\": false,\n     \"is_eligible_to_subscribe\": false,\n     \"subscribed\": false\n  }\n```\n\n``` javascript\n/**\n* Like Post\n* @param {string} shortCode\n* @param {string} request headers @optional - required for token authentication\n  */\n  try {\n    const requestHeaders = {\n    'Authorization':userDetails.headers[\"ig-set-authorization\"],\n    \"Ig-U-Ds-User-Id\": userDetails.headers[\"ig-set-ig-u-ds-user-id\"],\n    \"Ig-U-Rur\": userDetails.headers[\"ig-set-ig-u-rur\"],\n    \"X-Ig-Www-Claim\": userDetails.headers[\"x-ig-set-www-claim\"],\n    }\n    \n    const liked = await igService.like('shortCode', requestHeaders);\n    console.log(liked);\n  \n  } catch (error: any) {\n    console.error('Unknown error:', error);\n  }\n  \n{\n   \"status\": \"ok\"\n}\n```\n\n## License\n\nApache Version 2.0\n\nSee [LICENSE](https://github.com/appit-online/ionic-insta-api-wrapper/blob/master/LICENSE)\n","funding_links":[],"categories":["Third Party Components"],"sub_categories":["UI Library and Framework Ionic"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappit-online%2Fionic-insta-api-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappit-online%2Fionic-insta-api-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappit-online%2Fionic-insta-api-wrapper/lists"}