You inherit an Instagram content spreadsheet that contains Media IDs but no clickable sources. Reviewers cannot return to the posts to check quotations. Converting the identifiers can repair those references, although it cannot restore content that is no longer visible.

Preserve the original identifier column

Write conversion results into new columns. Keep long identifiers as text so spreadsheet formatting does not round digits or replace them with an altered value. Try a record whose destination you already know before processing the remaining rows. The original ID remains valuable even after a shorter code is available.

Build the post address from the shortcode

A successful conversion supplies the shortcode used in the documented Instagram post URL pattern. Store the conversion status, shortcode, and constructed address beside the Media ID. That makes it possible to distinguish a failed conversion from a later access problem. The address is a reference, not a download link or a source of performance statistics.

Verify access separately

Open a small selection of resulting links and compare them with the intended objects. Conversion success does not guarantee public availability. A restricted or removed post may remain inaccessible. Keep that access state unresolved until checked rather than assigning zero engagement. Your deliverable is a repaired source mapping, not a recovered archive of every historical post.

Request URL and parameters

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

Parameter Type Required Meaning
media_id string Yes Post media ID

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/media_id_to_shortcode"
params = {
    "media_id": "3774507992167247878"
}
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.