Tutorials · Instagram

Instagram API tutorials

Every public Instagram route, from profiles and newest-first followers to comments, stories, hashtags, places and audio, with tested code in six languages and both SDKs.

Short answer. Every Instagram route is GET https://api.handlehaul.com/v1/instagram/... with an X-Api-Key header. Name an account by username or numeric id; store the id from the first answer and send it afterwards to skip the lookup credit. Lists page with pagination.next_cursor.

Start with your language or tool

Language guide

Instagram and TikTok API in Python

Two ways to call HandleHaul from Python: a 60-line client on requests that you own, or the official handlehaul package (sync and async).

Language guide

Instagram and TikTok API in Node.js

Call HandleHaul from Node.js 18 or newer with the built-in fetch, or install the typed handlehaul package from npm, which also ships a CLI.

Language guide

Instagram and TikTok API in PHP

One class, PHP 8 and the curl extension: no Composer package needed.

Language guide

Instagram and TikTok API in Go

A standard-library Go client with generic Page[T] and One[T] types: decode the fields you need into structs, page with a callback, and get a typed APIError for anything else.

Language guide

Instagram and TikTok API in Ruby

A standard-library Ruby client: Net::HTTP, JSON and an Enumerator for cursor paging, so .first(100) or .take_while stops calling when you have enough.

Language guide

Instagram and TikTok API with cURL

Every route works from a terminal: one header, JSON back.

No code

Instagram and TikTok data in Google Sheets

Paste one Apps Script file, add your key as a script property, and a HandleHaul menu fills follower counts for a list of Instagram accounts and views, likes and saves for a list of TikTok videos.

No code

Instagram and TikTok data in n8n

n8n’s HTTP Request node can page through HandleHaul lists on its own: set one header credential, point it at a route, and tell it where the next cursor is.

No code

Instagram and TikTok data in Make

Make’s HTTP “Make a request” module calls any HandleHaul route.

No code

Instagram and TikTok data in Zapier

Two ways to call HandleHaul from a Zap: the Webhooks by Zapier GET action for a single request, or a Code by Zapier step when you want retries and only the fields you need.

Full scripts for common jobs

One complete program per job, from input list to CSV, in Python and in Node.js.

Every endpoint, in every language

One page per API route: why you would call it, the parameters, code in cURL, Python, Node.js, PHP, Go and Ruby (plus both SDKs), a sample response and what it costs.

Profiles

  • ProfileGET /v1/instagram/users/{user}Profile by username or id
  • Account detailsGET /v1/instagram/users/{user}/account-detailsWhen the account joined, its country and username changes
  • Similar accountsGET /v1/instagram/users/{user}/relatedAccounts similar to this one

Followers & following

  • FollowersGET /v1/instagram/users/{user}/followersFollowers, newest first
  • FollowingGET /v1/instagram/users/{user}/followingFollowing, newest first

Posts & reels

  • PostsGET /v1/instagram/users/{user}/postsRecent posts
  • ReelsGET /v1/instagram/users/{user}/reelsReels of an account, newest first (or most viewed)
  • Tagged postsGET /v1/instagram/users/{user}/taggedPosts the account is tagged in
  • RepostsGET /v1/instagram/users/{user}/repostsPosts the account reposted
  • Post or reelGET /v1/instagram/posts/{post}One post or reel by shortcode, id or URL
  • Post stats (batch)GET /v1/instagram/posts/statsLike, comment and view counts for up to 20 posts in one call

Comments & likes

  • CommentsGET /v1/instagram/posts/{post}/commentsComments on a post
  • Comment repliesGET /v1/instagram/comments/{comment}/repliesReplies to a comment
  • Post likersGET /v1/instagram/posts/{post}/likersAccounts that liked a post
  • Comment likersGET /v1/instagram/comments/{comment}/likersAccounts that liked a comment

Stories & highlights

  • StoriesGET /v1/instagram/users/{user}/storiesLive stories (last 24 hours)
  • Story by idGET /v1/instagram/stories/{story}One story by id
  • HighlightsGET /v1/instagram/users/{user}/highlightsStory highlights of an account
  • Highlight storiesGET /v1/instagram/highlights/{highlight}The stories inside a highlight

Hashtags

  • Search hashtagsGET /v1/instagram/search/hashtagsFind hashtags
  • HashtagGET /v1/instagram/hashtags/{tag}A hashtag and its post count
  • Hashtag postsGET /v1/instagram/hashtags/{tag}/postsTop posts for a hashtag

Locations

  • Search placesGET /v1/instagram/search/placesFind places by name or near a point
  • PlaceGET /v1/instagram/places/{place}A place: name, category, address, contact
  • Place postsGET /v1/instagram/places/{place}/postsTop or recent posts tagged at a place

Audio

  • Search audioGET /v1/instagram/search/audioFind songs and original audio
  • Trending audioGET /v1/instagram/audio/trendingTrending audio on Reels
  • AudioGET /v1/instagram/audio/{audio}A song or original audio
  • Reels using audioGET /v1/instagram/audio/{audio}/reelsReels that use an audio
  • Search accountsGET /v1/instagram/search/usersSearch accounts by name
  • URL resolverGET /v1/instagram/resolveInstagram URL → type and ids (free)

Instagram API tutorials: questions

Is there an Instagram API for public data without the Graph API?
Yes: HandleHaul returns public Instagram profiles, followers, posts, reels, comments, stories, hashtags, places and audio as JSON with one API key. No Instagram login, no Meta app review. The official Graph API covers only accounts that connect to your app. Not affiliated with Instagram or Meta.
Should I send usernames or numeric ids?
Naming an account by a handle we have not looked up in the last 7 days adds 1 lookup credit; send the numeric id from any result to skip it. Every profile and list row includes id: store it. Ids also survive username changes.
In what order do Instagram follower lists come back?
Newest first: position: 1 is the most recent follower, counting across pages, and meta.order says newest_first. Instagram shares no follow dates, and a page can occasionally be one row short, so never treat a row missing from one call as an unfollow.

Full reference: API docs. The other platform: TikTok API tutorials.

Run them on real Instagram data

One key for Instagram and TikTok. $1.40 to $0.80 per 1,000 calls; failed calls and cache hits are free.

Want to test first? Sandbox keys are free and unlimited, with sample data in the live schema.