# Instagram Posts By Date Range

**Use case:** 

Restrict the pull to a time window: set a start date, an end date, or both, and receive only posts published inside it. Works for profiles and hashtags. Rows outside the window are dropped before billing, so a narrow window costs less than a full profile sweep.

## Input

```json
{
  "usernames": [
    "nasa"
  ],
  "postsPerProfile": 12,
  "includeProfiles": true,
  "postUrls": [],
  "hashtags": [],
  "includeHashtagPosts": true,
  "locationUrls": [],
  "includeRelatedAccounts": false,
  "includeReelPlays": false,
  "includePostDetails": false,
  "onlyNew": false,
  "emitUnchanged": false,
  "maxItems": 100,
  "postedAfter": "2026-01-01",
  "postedBefore": "2026-06-30",
  "postTypes": [],
  "compactOutput": false,
  "excludeEmptyFields": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

## Output

```json
{
  "result_type": {
    "label": "result_type",
    "format": "string"
  },
  "url": {
    "label": "url",
    "format": "string"
  },
  "username": {
    "label": "username",
    "format": "string"
  },
  "full_name": {
    "label": "full_name",
    "format": "string"
  },
  "followers": {
    "label": "followers",
    "format": "integer"
  },
  "posts_count": {
    "label": "posts_count",
    "format": "integer"
  },
  "shortcode": {
    "label": "shortcode",
    "format": "string"
  },
  "post_type": {
    "label": "post_type",
    "format": "string"
  },
  "timestamp": {
    "label": "timestamp",
    "format": "string"
  },
  "likes": {
    "label": "likes",
    "format": "integer"
  },
  "comments": {
    "label": "comments",
    "format": "integer"
  },
  "plays": {
    "label": "plays",
    "format": "integer"
  },
  "caption": {
    "label": "caption",
    "format": "string"
  },
  "hashtags": {
    "label": "hashtags",
    "format": "array"
  },
  "owner_username": {
    "label": "owner_username",
    "format": "string"
  },
  "hashtag": {
    "label": "hashtag",
    "format": "string"
  },
  "media_count": {
    "label": "media_count",
    "format": "integer"
  },
  "change_type": {
    "label": "change_type",
    "format": "string"
  }
}
```

## About this Actor

This example demonstrates how to use [Instagram Scraper - Profiles, Posts, Reels, Hashtags, Places](https://apify.com/snow_leo_data/instagram-scraper.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/snow_leo_data/instagram-scraper.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/snow_leo_data/instagram-scraper.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
