Last updated
How to Get Instagram Media IDs
⚠️ Note: Instagram's public URLs use shortcodes (e.g., /p/ABC123/), not Snowflake IDs. Media IDs are internal identifiers used by Instagram's API and backend systems.
Instagram vs Twitter Snowflake Comparison
Feature Instagram Twitter
─────────────────────────────────────────────────
Epoch Jan 1, 2011 Nov 4, 2010
Epoch (Unix seconds) 1293840000 1288834974
Timestamp bits 41 bits 41 bits
Right-shift amount 23 bits 22 bits
Timestamp precision ~1 second ~1 millisecond
Machine ID bits ~10 bits 10 bits
Sequence bits ~12 bits 12 bits
Key implication:
Instagram timestamps are in seconds (lower precision)
Twitter timestamps are in milliseconds (higher precision)
Key Facts
- Instagram epoch: January 1, 2011 (Unix: 1293840000 seconds)
- Timestamp extracted by right-shifting the ID by 23 bits
- Works for post IDs, user IDs, comment IDs, and other Instagram objects
- Timestamp precision is to the second (not millisecond like Twitter)
- Always use BigInt in JavaScript to avoid precision loss
- Larger IDs = newer content (monotonically increasing)
Paste any Instagram Snowflake ID to instantly decode its creation timestamp.
1⃣ Instagram API
Use Instagram's Graph API or Basic Display API to retrieve media IDs from posts, stories, and reels. The id field contains the Snowflake ID.
2⃣ Browser DevTools
Inspect network requests when loading Instagram posts to find media IDs in API responses. Look for GraphQL or REST API calls.
3⃣ Analytics Tools
Some Instagram analytics tools expose media IDs for posts. Check your analytics dashboard or API documentation.
Instagram Snowflake Epoch
Instagram uses Unix epoch (January 1, 1970, 00:00:00 UTC) as its Snowflake epoch (0 milliseconds). This differs from Twitter and Discord which use custom epochs.
💡 Why Unix epoch? Instagram uses the standard Unix epoch with custom sharding logic, making their Snowflake IDs compatible with standard Unix timestamp tools.
Instagram Snowflake ID Structure
What Can You Decode?
Media IDs
Find when photos and videos were uploaded to Instagram. Track content creation timestamps.
Post IDs
Determine post creation timestamps. Useful for content scheduling analysis and engagement tracking.
Story IDs
See when stories were published. Track story posting patterns and timing strategies.
Reel IDs
Find reel upload dates. Analyze reel performance based on posting times.
Common Use Cases
Content Scheduling
Analyze Instagram post timing and scheduling patterns. Optimize posting times based on historical data.
Copyright Verification
Verify content upload dates for copyright claims and intellectual property disputes.
Activity Tracking
Track Instagram activity timelines. Monitor content creation patterns over time.
API Integration
Debug Instagram API integrations by verifying media ID timestamps and creation dates.
Content Research
Research Instagram content chronology. Track when viral content was originally posted.
Bot Development
Build Instagram bots and automation tools with accurate timestamp tracking.
Instagram vs Other Platforms
Instagram: Uses Unix epoch (0) - January 1, 1970, 00:00:00 UTC
Twitter: Uses custom epoch (1288834974657) - November 4, 2010
Discord: Uses custom epoch (1420070400000) - January 1, 2015
Unlike Twitter and Discord which use custom epochs, Instagram uses the standard Unix epoch. This means Instagram Snowflake IDs represent time since January 1, 1970, making them compatible with standard Unix timestamp tools.
Decode Instagram IDs in Your Code
// JavaScript
function decodeInstagramId(id) {
const INSTAGRAM_EPOCH = 0n; // Unix epoch
const snowflake = BigInt(id);
const timestamp = Number((snowflake >> 22n) + INSTAGRAM_EPOCH);
return new Date(timestamp);
}
// Example usage
const date = decodeInstagramId('2345678901234567890');
console.log(date.toISOString());
# Python
from datetime import datetime
def decode_instagram_id(snowflake_id):
INSTAGRAM_EPOCH = 0
timestamp = ((int(snowflake_id) >> 22) + INSTAGRAM_EPOCH) / 1000
return datetime.fromtimestamp(timestamp)
# Example usage
date = decode_instagram_id('2345678901234567890')
print(date.isoformat())
Why Instagram Uses Snowflake IDs
Instagram handles billions of media uploads across global data centers. Snowflake IDs provide:
- Time-ordered feeds: Content is naturally sorted by upload time
- Distributed generation: Multiple servers generate IDs without coordination
- High performance: Supports millions of uploads per second
- Efficient storage: 64-bit integers are compact and fast to index
- No collisions: Guaranteed uniqueness across all Instagram servers
Frequently Asked Questions
Q: Can I get media IDs from Instagram URLs?
A: Instagram public URLs use shortcodes, not Snowflake IDs. You need to use Instagram API or browser DevTools to extract media IDs.
Q: Why does Instagram use Unix epoch?
A: Instagram uses Unix epoch (0) with custom sharding logic, making their IDs compatible with standard timestamp tools while maintaining distributed generation.
Q: Can I decode Instagram story IDs?
A: Yes! Instagram stories use Snowflake IDs. If you have the story ID from the API, you can decode it to see when it was published.
Q: Is this tool free?
A: Yes, completely free with no signup required. All processing happens in your browser for privacy.
Examples
Example 1: Decoding Instagram Snowflake IDs
Instagram uses Snowflake-like IDs for all content:
Post ID: 2847392847392847392 → August 15, 2023 at 14:32:07 UTC
User ID: 1234567890 → ~2012 (early Instagram user)
Comment ID: 17987654321098765 → ~2021
Instagram Snowflake structure:
Bits 63-23: Timestamp (seconds since Jan 1, 2011)
Bits 22-0: Shard ID + sequence number
Formula:
INSTAGRAM_EPOCH = 1293840000 (Jan 1, 2011 in Unix seconds)
timestamp_seconds = (snowflake_id >> 23) + INSTAGRAM_EPOCH
created_at = datetime.fromtimestamp(timestamp_seconds)
Key difference from Twitter Snowflake:
Twitter: right-shift by 22 bits, epoch = Nov 4, 2010
Instagram: right-shift by 23 bits, epoch = Jan 1, 2011
Example 2: JavaScript Decoder
const INSTAGRAM_EPOCH = 1293840000; // Jan 1, 2011
function decodeInstagramSnowflake(snowflakeId) {
const id = BigInt(snowflakeId);
// Extract timestamp (right-shift by 23 bits)
const timestampSeconds = Number(id >> 23n) + INSTAGRAM_EPOCH;
const createdAt = new Date(timestampSeconds * 1000);
// Extract lower bits (shard + sequence)
const lowerBits = Number(id & 0x7FFFFFn); // 23 bits
return {
createdAt,
iso: createdAt.toISOString(),
timestampSeconds,
lowerBits,
approximateAge: getAge(createdAt)
};
}
function getAge(date) {
const ms = Date.now() - date.getTime();
const days = Math.floor(ms / 86400000);
const years = Math.floor(days / 365);
const months = Math.floor((days % 365) / 30);
if (years > 0) return `${years}y ${months}m ago`;
if (months > 0) return `${months} months ago`;
return `${days} days ago`;
}
// Usage:
const result = decodeInstagramSnowflake('2847392847392847392');
console.log(result.iso); // "2023-08-15T14:32:07.000Z"
console.log(result.approximateAge); // "1y 7m ago"
Example 3: Python Decoder
import datetime
INSTAGRAM_EPOCH = 1293840000
def decode_instagram_snowflake(snowflake_id: int) -> dict:
timestamp_seconds = (snowflake_id >> 23) + INSTAGRAM_EPOCH
created_at = datetime.datetime.fromtimestamp(
timestamp_seconds,
tz=datetime.timezone.utc
)
now = datetime.datetime.now(tz=datetime.timezone.utc)
age = now - created_at
return {
'created_at': created_at,
'timestamp_seconds': timestamp_seconds,
'age_days': age.days,
'formatted': created_at.strftime('%Y-%m-%d %H:%M:%S UTC')
}
# Decode a post ID:
result = decode_instagram_snowflake(2847392847392847392)
print(result['formatted'])
# → "2023-08-15 14:32:07 UTC"
# Decode a user ID (approximate account creation date):
user_result = decode_instagram_snowflake(1234567890)
print(user_result['formatted'])
# → approximate account creation date