Use the APIVex Instagram API to retrieve public profile information, posts, reels, comments, and other documented Instagram data over HTTPS. A useful first workflow looks up a profile, fetches its posts, and retrieves details or comments for selected posts.
This guide covers APIVex's third-party data service. For an integration involving account authorization or publishing, consult Meta's Instagram platform and evaluate the appropriate official product separately.
Which identifier does each endpoint need?
| Task | Endpoint | Input |
|---|---|---|
| Profile information | GET /api/user/info | username_or_id |
| Profile posts | GET /api/user/posts | username_or_id |
| Profile reels | GET /api/user/reels | username_or_id |
| Followers | GET /api/user/followers | username_or_id |
| One post | GET /api/post/detail | code_or_url |
| Post comments | GET /api/post/comments | code_or_url |
| Hashtag posts | GET /api/hashtag/posts | keyword |
All paths above use the base https://api.apivex.com/instagram. The Instagram API reference lists optional inputs and additional routes.
A username or numeric user ID identifies an account. A shortcode identifies a post. A full post URL is accepted by the code_or_url routes. Keeping these inputs distinct prevents a common class of empty or invalid lookups.
Look up a public profile
Set APIVEX_API_KEY in your shell environment and run this Bash/cURL example:
curl --get 'https://api.apivex.com/instagram/api/user/info' \
--header "x-apivex-key: $APIVEX_API_KEY" \
--data-urlencode 'username_or_id=instagram'The endpoint documents profile information including biography, profile picture, and follower/following counts. Inspect the response structure and validate the specific fields your application needs before storing them.
If your task is to track a follower count, begin with profile information. Fetching the paginated list of follower accounts is a different, potentially much larger job.
Fetch the profile's posts
curl --get 'https://api.apivex.com/instagram/api/user/posts' \
--header "x-apivex-key: $APIVEX_API_KEY" \
--data-urlencode 'username_or_id=instagram'The posts route documents media URLs, captions, and engagement counts. It accepts pagination_token for subsequent pages. Omit that input for the first request; inspect the response for the continuation token and pass it back unchanged when requesting the next page.
Do not invent a page number or assume the token field has the same name on every route. Other endpoints can use different cursor inputs. Stop when no continuation is available, a token repeats, or your configured page budget is reached.
Retrieve details and comments for a selected post
Set POST_URL to a public Instagram post URL from your selected content:
curl --get 'https://api.apivex.com/instagram/api/post/detail' \
--header "x-apivex-key: $APIVEX_API_KEY" \
--data-urlencode "code_or_url=$POST_URL"Use the same code_or_url input with /api/post/comments to request comments. That route also supports pagination_token. If you need replies to a particular comment, /api/post/comment-replies requires both code_or_url and a comment_id obtained from the comments response.
Fetch only the content needed for your analysis. A profile monitoring job may need counts and recent posts without collecting every comment or follower record.
Build a profile monitoring workflow
For each account, retain its source identifier and the timestamp of your observation. Store post IDs separately and deduplicate posts across pages and repeated runs. Preserve missing fields as unknown rather than assigning zeros.
A change in a returned count is an observation between two retrievals. It does not explain why the count changed. Compare similar time intervals, and distinguish your retrieval timestamp from a post's publication timestamp.
For media, store the source reference alongside the returned URL. A media URL may stop working later; avoid treating it as permanent storage for an application asset.
Scope and troubleshooting
This workflow is for accessible public data. It does not grant access to private account content or turn a read endpoint into a publishing action. Source availability can change, and not every account or post will return every field.
If a profile lookup fails, confirm the username or numeric ID. If a post lookup fails, use a post shortcode or URL rather than an account username. For pagination errors, remove the cursor and retry the first page to distinguish an invalid continuation from a lookup problem.
For rejected requests, inspect the status and error response and verify the x-apivex-key header. Use bounded retries for temporary failures, and review your plan and usage before expanding a collection job.
Next step
Test a profile in the Instagram documentation, then choose the posts, reels, or comments route that serves your task. For another social data source, see the TikTok API guide. Spreadsheet users can follow the separate Sheets add-on tutorial.



