Instagram Hashtag Feed API (0.1.0)

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

Feed

Overview

The Instagram Hashtag Feed API provides a simple way to retrieve social media posts filtered by hashtags. The API supports two modes:

  • Mock Mode (default): Returns sample data perfect for testing and demonstrations without requiring any credentials
  • Instagram Mode: Fetches real data from the Instagram Graph API (requires authentication)

Pagination

The API uses simple limit-based pagination:

  • Use the limit parameter to control the number of results (1-100)
  • Results are always sorted newest-first by timestamp
  • Maximum limit is 100 items per request
  • For production applications, consider implementing cursor-based pagination

Error Handling

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 error
  • details: Additional information about what went wrong

Common Errors

Instagram 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.

Get a chronological feed for hashtags

Returns a list of social media posts filtered by hashtags, sorted by newest first

query Parameters
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

Responses

Response samples

Content type
application/json
{}