A colleague sends ten Instagram links showing shop displays. Your next lookup asks for a media ID, but the links contain short strings of letters and numbers. You need an identifier conversion, not another search for the shops.

Take the shortcode from the post link

In the documented example instagram.com/p/DRhvwVLAHAG/, the shortcode is DRhvwVLAHAG. Preserve its case. Do not include the trailing slash, tracking query or creator name in the shortcode parameter. Try one known post before preparing the rest of the list, and retain the original link so someone can still inspect the reference.

Keep both identifiers on the same row

The response description lists status, shortcode and media_id. Check the conversion status and match the returned shortcode to your input before saving the media ID. Useful worksheet columns are original link, supplied shortcode, returned media ID, conversion status and review notes. These columns help reconcile duplicate submissions without losing the reasons different colleagues saved a post.

Check what the next endpoint accepts

A media ID belongs only in a parameter that expects one. Do not substitute it for a shortcode or an account identifier. Conversion does not itself retrieve display photographs, explain shelf layouts or provide a content analysis. Those tasks require the appropriate detail lookup or inspection of the original post.

Keep conversion and availability separate

A successful conversion does not promise that the post will remain accessible later. If conversion fails, check for a truncated shortcode and retain the returned status. Never invent an identifier just to keep a worksheet moving. The finished mapping should let another person return to the source and understand exactly which subsequent lookup the ID was prepared for.

Request URL and parameters

GET https://api.trmesh.com/openapi/api/v1/instagram/v1/shortcode_to_media_id

Parameter Type Required Meaning
shortcode string Yes Post shortcode

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/v1/shortcode_to_media_id"
params = {
    "shortcode": "DRhvwVLAHAG"
}
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.