> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thehog.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List Instagram posts

> Fetch recent posts for an Instagram username.

# POST /api/v1/platform/scrapers/instagram/posts

> Fetch recent posts from an Instagram account.

Retrieve recent posts from a public Instagram account.

## Example

```bash theme={null} theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST https://developer.thehog.ai/api/v1/platform/scrapers/instagram/posts \
  -H "X-Access-Key: ak_xxxxxxxxxxxxxxxx" \
  -H "X-Secret-Key: sk_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"username": "instagram", "maxPosts": 12}'
```


## OpenAPI

````yaml api-reference/openapi.json POST /api/v1/platform/scrapers/instagram/posts
openapi: 3.0.0
info:
  title: The Hog API
  description: Public API reference for The Hog.
  version: '1.0'
  contact: {}
servers:
  - url: https://developer.thehog.ai
security: []
tags: []
paths:
  /api/v1/platform/scrapers/instagram/posts:
    post:
      tags:
        - Scrapers
      summary: List Instagram posts
      description: Fetch recent posts for an Instagram username.
      operationId: listInstagramPosts
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformInstagramUsernameDto'
      responses:
        '200':
          description: Instagram posts.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                additionalProperties: false
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/InstagramPostResponseDto'
                  meta:
                    $ref: '#/components/schemas/PublicResponseMetaDto'
        '400':
          description: The request body or parameters are invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponseDto'
              example:
                statusCode: 400
                error: Bad Request
                message: Validation failed
                path: /api/v1/search
                timestamp: '2026-05-21T09:08:10.000Z'
                requestId: 506af9b3-01a9-43be-9eb4-8458fe3e4f5b
                errors:
                  - property: body.query
                    message: query must be a string
                    constraints:
                      isString: query must be a string
        '401':
          description: Authentication is required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponseDto'
              example:
                statusCode: 401
                error: Unauthorized
                message: Authentication is required.
                path: /api/v1/search
                timestamp: '2026-05-21T09:08:10.000Z'
                requestId: 506af9b3-01a9-43be-9eb4-8458fe3e4f5b
        '402':
          description: The organization does not have enough credits for this request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponseDto'
              example:
                statusCode: 402
                error: Payment Required
                message: Insufficient credits.
                path: /api/v1/search
                timestamp: '2026-05-21T09:08:10.000Z'
                requestId: 506af9b3-01a9-43be-9eb4-8458fe3e4f5b
        '500':
          description: An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponseDto'
              example:
                statusCode: 500
                error: Internal Server Error
                message: An unexpected error occurred.
                path: /api/v1/search
                timestamp: '2026-05-21T09:08:10.000Z'
                requestId: 506af9b3-01a9-43be-9eb4-8458fe3e4f5b
        '502':
          description: The upstream service could not complete the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponseDto'
              example:
                statusCode: 502
                error: Bad Gateway
                message: An unexpected error occurred.
                path: /api/v1/search
                timestamp: '2026-05-21T09:08:10.000Z'
                requestId: 506af9b3-01a9-43be-9eb4-8458fe3e4f5b
      security:
        - AccessKey: []
          SecretKey: []
components:
  schemas:
    PlatformInstagramUsernameDto:
      type: object
      properties:
        username:
          type: string
          example: instagram
        maxPosts:
          type: number
          minimum: 1
          maximum: 200
      required:
        - username
    InstagramPostResponseDto:
      type: object
      properties:
        shortcode:
          type: string
        post_url:
          type: string
          nullable: true
        post_type:
          type: string
          nullable: true
        caption:
          type: string
          nullable: true
        hashtags:
          nullable: true
          type: array
          items:
            type: string
        mentions:
          nullable: true
          type: array
          items:
            type: string
        likes_count:
          type: number
          nullable: true
        comments_count:
          type: number
          nullable: true
        video_views_count:
          type: number
          nullable: true
        display_url:
          type: string
          nullable: true
        dimensions_height:
          type: number
          nullable: true
        dimensions_width:
          type: number
          nullable: true
        is_sponsored:
          type: boolean
          nullable: true
        location_name:
          type: string
          nullable: true
        location_id:
          type: string
          nullable: true
        posted_at:
          type: string
          nullable: true
        author_username:
          type: string
          nullable: true
        owner_id:
          type: string
          nullable: true
      required:
        - shortcode
    PublicResponseMetaDto:
      type: object
      properties:
        requestId:
          type: string
      required:
        - requestId
    PublicErrorResponseDto:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        error:
          type: string
          example: Bad Request
        message:
          type: string
          example: Validation failed
        path:
          type: string
          example: /api/v1/search
        requestId:
          type: string
          example: 506af9b3-01a9-43be-9eb4-8458fe3e4f5b
        timestamp:
          type: string
          example: '2026-05-21T09:08:10.000Z'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/PublicValidationErrorItemDto'
      required:
        - statusCode
        - error
        - message
        - path
        - timestamp
    PublicValidationErrorItemDto:
      type: object
      properties:
        property:
          type: string
          example: body.query
        message:
          type: string
          example: query must be a string
        constraints:
          type: object
          additionalProperties:
            type: string
          example:
            isString: query must be a string
      required:
        - property
        - message
  securitySchemes:
    AccessKey:
      type: apiKey
      in: header
      name: X-Access-Key
      description: The public API key from the Credentials page.
    SecretKey:
      type: apiKey
      in: header
      name: X-Secret-Key
      description: The API secret shown when the credential is created.

````