Download OpenAPI specification:
Simple API that returns chronological posts for provided hashtags. Supports "mock" mode (no credentials) and optional "instagram" mode (requires Instagram Graph API tokens).
Main Portfolio: https://anandiwrites.dev
The Instagram Hashtag Feed API provides a simple way to retrieve social media posts filtered by hashtags. The API supports two modes:
The API uses simple limit-based pagination:
limit parameter to control the number of results (1-100)The API returns descriptive error messages with appropriate HTTP status codes:
| Status Code | Description |
|---|---|
| 200 | Success - feed items returned |
| 400 | Bad request - invalid parameters |
| 502 | Upstream error - Instagram API failure or misconfiguration |
All error responses include:
error: A code or short message describing the errordetails: Additional information about what went wrongInstagram Mode Not Configured
{
"error": "failed_to_fetch_feed",
"details": "INSTAGRAM_ACCESS_TOKEN and INSTAGRAM_BUSINESS_ACCOUNT_ID required"
}
Rate Limiting
The API implements built-in caching (default TTL: 120 seconds) to reduce load on the Instagram Graph API. Identical requests within the cache window will return cached results.
Returns a list of social media posts filtered by hashtags, sorted by newest first
| hashtags | string Default: "family,kids,nyc" Example: hashtags=family,kids,nyc Comma-separated list of hashtags to search |
| limit | integer [ 1 .. 100 ] Default: 25 Maximum number of items to return (1-100) |
| mode | string Default: "mock" Enum: "mock" "instagram" Data source - "mock" returns sample data, "instagram" fetches from Instagram Graph API |
{- "count": 2,
- "items": [
- {
- "id": "mock-family-1",
- "caption": "Mock post for #family — kid-friendly example",
- "username": "family_demo",
- "timestamp": "2025-11-11T16:00:00.000Z",
- "hashtags": [
- "family"
]
}, - {
- "id": "mock-kids-2",
- "caption": "Mock post for #kids — kid-friendly example",
- "username": "kids_demo",
- "timestamp": "2025-11-11T15:00:00.000Z",
- "hashtags": [
- "kids"
]
}
]
}