GET/desearch/instagram/hashtag/{tag}

    Retrieve Instagram Hashtag Media

    Retrieve normalized public Instagram media for a hashtag. Instagram trending is not exposed until a stable unauthenticated public surface is selected. Billing metadata: successful billable responses include the `X-Desearch-Cost-Usd`, `X-Desearch-Usage-Count`, `X-Desearch-Service`, and `X-Desearch-Currency` headers. JSON object responses also include optional `cost_usd`, `usage_count`, `service`, and `currency` fields. Current prices are at https://desearch.ai/pricing. JSON arrays, text, and streaming responses keep their body shape and expose billing metadata only through headers.

    Base URL

    https://api.desearch.ai

    Implementation guidance

    Use Retrieve Instagram Hashtag Media when your application needs search-grounded AI results without maintaining its own crawler, social-data pipeline, or retrieval infrastructure. Use this Instagram route to retrieve normalized public media associated with a hashtag. The required tag path string contains the hashtag itself, without #. Optional query controls are count and cursor: the count is an integer with a 20 default, a minimum of 1, and a maximum of 100. This is a page ceiling rather than a promise of that many media records. For the initial hashtag page, leave cursor unset. Continue only with the opaque x-desearch-next-cursor header returned by the preceding response, passing it unmodified as cursor for this same tag and route. No such header is returned for the final page. A cursor lasts 24 hours; an expired token, one from a different target or route, or another invalid value results in an uncharged 422 rejection before search execution. The successful response accepts a list of InstagramMedia objects or a JSON object. Media identifiers are nullable strings named shortcode and id, and the media's url is also nullable. The caption is available as caption, not as a guaranteed nonempty text value: its type permits string or null. createTime, mediaType, mediaUrl, and thumbnailUrl follow the same nullable-string typing. There is no enumerated set of media-type values in this schema. Media can include hashtags and mentions as arrays of strings, plus children as an array of objects; no child-property schema is specified. Treat the optional nullable pinned boolean as a profile-placement signal: true means the post is pinned to the profile's top. Engagement belongs to a nullable stats object whose likeCount, commentCount, viewCount, and playCount fields are integers that may be null. The nullable media author uses InstagramProfile. This author schema includes nullable strings for fullName, username, id, biography, avatar, externalUrl, category, and city, and nullable booleans for private and verified. Its bioLinks can be a string array or null. Author followers is an exact count only when Instagram shows one and otherwise is omitted. Likewise, postsCount is the exact account total when shown, and is omitted when only the current page could be read; neither value is the requested hashtag page size. Billing for successful chargeable responses is reported in four headers: X-Desearch-Cost-Usd, X-Desearch-Usage-Count, X-Desearch-Service, and X-Desearch-Currency. An object body may additionally expose cost_usd, usage_count, service, and currency, all optional; array responses put that metadata only in headers. Instagram trending is not exposed pending selection of a stable unauthenticated public surface. For media from one known account, choose Instagram profile posts; the Instagram API overview describes the available route family. The endpoint returns structured data that can be consumed by agents, research tools, dashboards, and retrieval-augmented generation workflows. Keep the request focused on the minimum fields your workflow needs so responses remain fast and easy to validate.

    Send requests to GET /desearch/instagram/hashtag/{tag} with your Desearch API key in the authorization header. Treat the key as a server-side secret, validate all required parameters before sending the request, and handle non-2xx responses explicitly. Production integrations should use sensible timeouts, retry only transient failures with backoff, and record the response status and request identifier for troubleshooting.

    Test the example request below before integrating it into a larger workflow. Confirm that the returned fields, links, and timestamps meet your freshness requirements, then add schema validation at the application boundary. For agentic systems, preserve source URLs with the generated answer so users can inspect evidence and your application can avoid presenting unsupported claims.

    Path Parameters

    tagstringrequired

    Hashtag without #

    Query Parameters

    countinteger

    Maximum number of items to return. A page may hold fewer.

    Default: 20

    cursorstring

    Opaque pagination cursor. Omit it for the first page. For the next page, send the `x-desearch-next-cursor` response header from the previous page back unchanged, on the same route with the same target (username, tag, post, or search query). A cursor is valid for 24 hours. Any other value, including an expired cursor or one issued by a different route or target, returns 422 and is not charged.

    Responses

    200A list of normalized Instagram media objects.
    301Moved Permanently
    304Not Modified
    401Unauthorized
    422Validation Error, or the `cursor` is not one this route issued for this target, or it has expired. An invalid cursor is rejected before any search runs and is not charged.
    429Too Many Requests
    500Internal Server Error
    Authorization

    Your API key is sent in the Authorization header.

    Request
    curl -X GET "https://api.desearch.ai/desearch/instagram/hashtag/bittensor" \
      -H "Authorization: YOUR_API_KEY" \
      -H "Content-Type: application/json"
    GET /desearch/instagram/hashtag/{tag}
    ResponseSchema
    [
      {
        "id": "3234567890123456789",
        "shortcode": "DY79rTVS6OK",
        "url": "https://www.instagram.com/p/DY79rTVS6OK/",
        "caption": "caption text",
        "createTime": "2024-01-15T10:30:00Z",
        "mediaType": "image",
        "mediaUrl": "https://example.com/media.jpg",
        "thumbnailUrl": "https://example.com/thumb.jpg",
        "author": {
          "id": "12345",
          "username": "instagram",
          "fullName": "Desearch",
          "biography": "Search AI",
          "avatar": "https://example.com/avatar.jpg",
          "verified": true,
          "private": false,
          "followers": 50000,
          "following": 1200,
          "postsCount": 250,
          "externalUrl": "https://desearch.ai",
          "bioLinks": [
            "https://linktr.ee/name"
          ],
          "category": "Software",
          "city": "Tbilisi, Georgia"
        },
        "stats": {
          "likeCount": 5000,
          "commentCount": 120,
          "viewCount": 120000,
          "playCount": 120000
        },
        "pinned": true,
        "hashtags": [
          "string"
        ],
        "mentions": [
          "string"
        ],
        "children": [
          {}
        ]
      }
    ]
    Status codes200301304401422429500