After an event, you want to organize the work on your Instagram account. Some posts contain one photo, some a carousel and others a video. Keeping only covers can miss the material you actually need.

Preserve account-list pagination

The user-post endpoint takes username and documented pagination parameters. Use a coherent paging approach and retain the returned cursors and coverage. Verify the account first. Publication date alone does not establish which event a post belongs to, so check the content.

Inspect the post using its code

The detail request accepts code rather than a username or complete sharing message. Examine the actual content type and available media information. A carousel cover does not describe every item, and a static video image is not a usable video file. Do not guess nested fields from another endpoint's structure.

Organize the index around sources

Your index can contain post source, event segment, media-item note, lookup time and later saving status. Add your own explanation of where each reference fits in the recap. AI may organize supplied descriptions but must not invent media links.

Verify file handling separately

These lookups do not mean downloading is complete or addresses remain usable forever. A later saving process must actually run and check its output against the source. Record unavailable results rather than assuming deletion. The outcome is a traceable event-media index, not an automatically edited recap or republished collection.

Requests used in this project

Request URL and parameters

GET https://api.trmesh.com/openapi/api/v1/instagram/v3/get_user_posts

Parameter Type Required Meaning
username string Yes Instagram username (without @)
first integer No Number of posts per page (forward)
after string No Forward pagination cursor (end_cursor)
before string No Backward pagination cursor (start_cursor)
last integer No Number of posts per page (backward)
count integer No Number of posts for first request

Run the Python example

Install requests and set TRMESH_API_TOKEN in your environment. Replace the sample identifiers with the public object you intend to inspect. Example IDs may no longer be available.

import os
import requests

# Read your own developer key from the server environment.
url = "https://api.trmesh.com/openapi/api/v1/instagram/v3/get_user_posts"
params = {
    "username": "99brasil"
}
response = requests.get(
    url, params=params, timeout=30,
    headers={"Authorization": f"Bearer {os.environ['TRMESH_API_TOKEN']}"},
)
response.raise_for_status()
payload = response.json()
print(payload)  # Inspect the actual response before mapping fields

Endpoint documentation · Free profile tool

API calls use your TRMesh account allowance. Check the endpoint price before running a script.