# Instagram Post Search Scraper | Keywords, Country & Dates (`lofomachines/instagram-post-search-scraper`) Actor

Find public Instagram posts for a list of keywords. Choose a country and dates, then export post links, text, authors, publication dates and available engagement to CSV, Excel or JSON.

- **URL**: https://apify.com/lofomachines/instagram-post-search-scraper.md
- **Developed by:** [Lofomachines](https://apify.com/lofomachines) (community)
- **Features:** Limited permissions, Multi-tenant, Server interface
- **Stats:** 5 total users, 0 monthly users, 90.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.22 / 1,000 post saveds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

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 examples already wired to this Actor's own input schema, see the [API](#api) section below.

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`).

# README

## Instagram Post Search Scraper

Find public Instagram posts and Reels by keyword, country and date. Compare campaign mentions, follow local events or discover creators discussing a product. Export results to Excel, CSV or JSON.

Enter one phrase per line (up to 100), choose a search market and set the maximum posts per keyword (1–3,000). The country steers search relevance. Publication dates must fall within the last 12 months. Choose Fast for a quick sample or Exhaustive for wider coverage. With dates selected, the Actor also checks individual days. Fast prioritizes searches that keep finding new posts.

**Exhaustive** provides broader, adaptive coverage. It checks date windows distributed across the selected period, opens more pages, and explores productive windows in greater detail. Empty pages stop immediately; repeated pages stop when they no longer add new posts. Unproductive windows do not trigger a day-by-day sweep. Short ranges receive daily checks; longer ranges combine wider windows with selected days. Neither mode guarantees every available post.

The run summary reports date windows checked and days not checked individually. `diminishingReturns` means additional checks stopped adding new posts, not that no posts exist in the skipped periods. Failed requests remain eligible for recovery and are not counted as empty results.

**Example input**

```json
{"keywords":["Milano Design Week","Fuorisalone"],"country":"IT","maxPostsPerQuery":25,"searchMode":"fast"}
```

**Example output (illustrative excerpt)**

```json
{"keyword":"Fuorisalone","postType":"reel","text":"Milano Design Week #design","likeCount":185,"commentCount":12,"hashtags":["#design"]}
```

Open **Output** to export links, captions, hashtags, available author details, dates and engagement. Missing counts appear empty. Dates come from the post, its public preview or, when marked `mediaId`, the creation time encoded in the media identifier. A post matching multiple keywords appears once for each. Open the run summary to see coverage per keyword. Public availability and search coverage vary.

**Italiano** — Trova post e Reel pubblici per parola chiave, paese e data. Per monitorare una fiera, inserisci nome e hashtag su righe separate, seleziona Italia e i giorni della manifestazione. Esporta i risultati in Excel.

Exhaustive distribuisce i controlli sull’intero periodo e approfondisce le finestre produttive. Salta le pagine vuote e interrompe quelle che non aggiungono post nuovi, senza controllare singolarmente ogni giorno degli intervalli lunghi. Puoi impostare fino a 3.000 post per keyword.

**Español** — Busca publicaciones y Reels públicos por tema, país y fecha. Introduce una frase por línea, elige el mercado y descarga los resultados en CSV.

Exhaustive distribuye las comprobaciones por todo el período y profundiza en las ventanas productivas. Omite páginas vacías y detiene las que ya no añaden publicaciones nuevas; no revisa cada día de los períodos largos. Puedes solicitar hasta 3.000 publicaciones por palabra clave.

**Français** — Retrouvez des publications et des Reels publics par mot-clé, pays et date. Choisissez un plafond par expression et exportez les résultats dans Excel.

Exhaustive répartit les vérifications sur toute la période et approfondit les fenêtres productives. Les pages vides ou sans nouvelles publications sont arrêtées; chaque jour des longues périodes n’est pas vérifié individuellement. La limite est de 3 000 publications par mot-clé.

[Discover more LofoMachines Actors](https://apify.com/lofomachines)

### Search API: connect your workflow

Use **Input** for a saved, exportable dataset, or **Server → POST /search → Try it out** for an immediate JSON response in your app or automation. Both interfaces accept the same keywords, country, dates and maximum of **3,000 posts per keyword**. Batch remains the best choice for large collections and longer Exhaustive searches.

The server supports both **single-tenant** and **multi-tenant** operation. Apify activates one tenancy at a time in **Settings → Server**. Each request is isolated: its results are returned only in its response and are not written to a shared dataset. Plan-based event prices apply. See the pricing section below and the live Pricing tab before starting a search.

**Example request — POST /search**

```json
{"keywords":["Milano Design Week"],"country":"IT","maxPostsPerQuery":3,"searchMode":"fast"}
```

Copy the server URL from the **Server** tab. Authenticate with `Authorization: Bearer <APIFY_TOKEN>` in your HTTP client. The interactive Server form handles authentication for you. `GET /health` checks readiness; `GET /openapi.json` describes the API.

**Example response — illustrative excerpt**

```json
{"requestId":"example","status":"completed","partialReason":null,"items":[{"keyword":"Milano Design Week","country":"IT","postType":"post","title":"Design week highlights"}],"summary":{"totalPosts":1,"maxPostsPerQuery":3},"nextStep":null}
```

Each HTTP request collects for up to **220 seconds**, allows up to 100 keywords and accepts the full 1–3,000 per-keyword cap. The cap is a maximum, not a promised result count. Responses are limited to 16 MiB; the request body limit is 256 KiB. A time or size cutoff returns the collected items with `status: "partial"`, a reason and per-keyword counts. Missing public metadata stays empty. For a complete longer attempt, use the same input in the **Input** tab; server responses are not resumable batch checkpoints.

An empty successful search returns HTTP 200 with no items. Invalid input returns 400; missing server authentication returns 401; excessive body size returns 413; unsupported content type returns 415. A busy server returns 429 with `Retry-After`. A failed search with no results returns 503; available partial results remain explicit in the response. Disconnecting cancels the request's work.

#### API: Italiano

Apri **Server → POST /search → Try it out** per ricevere i post direttamente in JSON, con le stesse keyword, paese, date e massimo di 3.000 post per keyword. Le richieste sono isolate e non salvano i risultati in un dataset condiviso. Sono supportati single-tenant e multi-tenant, con una tenancy attiva alla volta. Dopo 220 secondi o al limite della risposta, `partial` segnala i risultati parziali; per raccolte lunghe usa **Input** e il dataset esportabile.

#### API: Español

Abre **Server → POST /search** para recibir JSON con las mismas palabras clave, país, fechas y hasta 3.000 publicaciones por palabra clave. Las solicitudes están aisladas, sin dataset compartido. Admite single-tenant y multi-tenant, uno activo a la vez. Cada solicitud tiene 220 segundos; `partial` indica una colección incompleta. Usa **Input** para trabajos largos.

#### API: Français

Ouvrez **Server → POST /search** pour recevoir du JSON avec les mêmes mots-clés, pays, dates et une limite de 3 000 publications par mot-clé. Les requêtes sont isolées, sans dataset partagé. Les modes single-tenant et multi-tenant sont pris en charge, un seul étant actif à la fois. Après 220 secondes, `partial` signale une collecte incomplète. Utilisez **Input** pour les collectes longues.

[Discover more LofoMachines Actors](https://apify.com/lofomachines)

### Clear pricing for bulk searches and API workflows

Post rows have the same plan-based rate in batch and server responses. Higher Apify plans receive automatic discounts; Platinum and Diamond use the Gold rates. The result cap is not a prepaid package: post charges apply only to rows actually delivered. A post matching two keywords can appear and be charged once under each keyword.

| Charge | Free | Starter / Bronze | Scale / Silver | Business / Gold |
|---|---:|---:|---:|---:|
| 1,000 post rows | $0.39 | $0.29 | $0.25 | $0.22 |
| Each accepted keyword | $0.001 | $0.001 | $0.0009 | $0.0008 |
| Each processing block | $0.003 | $0.003 | $0.0026 | $0.0023 |
| Each API search request (server only) | $0.004 | $0.004 | $0.0035 | $0.003 |

A **processing block** is up to 60 seconds of active collection at 512 MB, 30 seconds at 1 GB, 15 seconds at 2 GB or 7.5 seconds at 4 GB. Each started block is charged in advance, including the first block. Longer searches use more blocks. Each server request has its own processing blocks; idle server time does not create processing events.

Batch runs and single-tenant server runs also have the standard **Actor start** charge of $0.00005 per GB of allocated memory, minimum one event. Multi-tenant API users pay the API request charge instead of an Actor start charge for a shared run. Keyword and processing charges apply even when no matching posts are found. Invalid server input, readiness checks and the API schema do not trigger custom event charges.

**Example at the Starter rate:** a batch delivering 1,000 post rows from 10 accepted keywords and using 2 processing blocks costs the post price above + $0.01 for keywords + $0.006 for processing, plus Actor start. The equivalent API request adds $0.004 for the request. This example counts work units, not a promise about the time or result count of your search.

Platform usage is included for batch and multi-tenant API searches. Apify always adds infrastructure usage separately for **single-tenant servers**. Use the **maximum cost** setting for batch runs. For API requests, optionally set the `X-Search-Max-Charge-Usd` header (default $10). The API conservatively checks that budget using the highest plan rate; discounts can make the actual charge lower. A budget stop returns available paid rows with `partialReason: "spendingLimit"`; a starting budget that cannot cover setup and one potential post returns HTTP 402. The remaining post budget also limits collection work before pages are opened.

Partial searches charge only delivered rows plus the accepted keywords and started processing blocks. A disconnected API request stops collecting; accepted-work charges may already apply. Post charges are recorded immediately before the response is sent. If disconnection is detected before that step, no post charge is added; a connection failure during delivery may leave an already recorded charge. Batch checkpoint continuation does not charge its submitted keywords again. See the live **Pricing** tab for the active prices.

**Italiano:** prezzi per post con sconti automatici in base al piano; si aggiungono keyword accettate e blocchi di elaborazione, anche per ricerche vuote. Le chiamate server hanno una piccola tariffa per richiesta. Il prezzo totale dipende dai risultati e dal lavoro svolto: consulta la tabella e imposta un budget.

**Español:** descuentos automáticos por plan. Además de las publicaciones entregadas, se cobran las palabras clave aceptadas y los bloques de procesamiento, incluso sin resultados; la API añade una tarifa por solicitud. Consulta la tabla y define un presupuesto.

**Français:** remises automatiques selon le forfait. Les mots-clés acceptés et les blocs de traitement sont facturés même sans résultat, en plus des publications livrées; l’API ajoute des frais par requête. Consultez le tableau et fixez un budget.

**Deutsch:** automatische Rabatte je Tarif. Zusätzlich zu gelieferten Beiträgen werden angenommene Suchbegriffe und Verarbeitungsblöcke auch bei leeren Suchen berechnet; die API berechnet eine Gebühr pro Anfrage. Preise und Budget vor dem Start prüfen.

**Português:** descontos automáticos por plano. Além das publicações entregues, há cobranças por palavras-chave aceitas e blocos de processamento, mesmo sem resultados; a API inclui uma tarifa por solicitação. Consulte a tabela e defina um orçamento.

[Discover more LofoMachines Actors](https://apify.com/lofomachines)

# Actor input Schema

## `keywords` (type: `array`):

Enter one brand, event or phrase per line. Add up to 100 keywords of 200 characters each. The limit below applies separately to every keyword.

## `country` (type: `string`):

Choose a market to prioritize results relevant to that country. Leave Worldwide for a broader search. The author’s location may differ.

## `newerThan` (type: `string`):

Choose a UTC date from the last 12 months, including today. Leave empty to allow posts back to the same date last year. Earlier and future dates are rejected.

## `olderThan` (type: `string`):

Choose a UTC date from the last 12 months, up to and including today. Leave empty to include today. Use the same date in both calendars for one day.

## `maxPostsPerQuery` (type: `integer`):

Return up to this many posts for each keyword (1–3,000). Fewer posts may be available. Start with 10 to preview a topic.

## `searchMode` (type: `string`):

Fast finds an economical sample. Exhaustive checks more pages and date windows across your selected period, explores productive windows, and stops searches that no longer add new posts. It skips unproductive days instead of checking every day separately. Neither mode guarantees every available post. Both respect your per-keyword limit.

## Actor input object example

```json
{
  "keywords": [
    "film festival"
  ],
  "country": "ANY",
  "maxPostsPerQuery": 50,
  "searchMode": "fast"
}
```

# Actor output Schema

## `posts` (type: `string`):

One row per public post for each matching keyword.

## `summary` (type: `string`):

Coverage and counts for this run.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "keywords": [
        "film festival"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("lofomachines/instagram-post-search-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "keywords": ["film festival"] }

# Run the Actor and wait for it to finish
run = client.actor("lofomachines/instagram-post-search-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "keywords": [
    "film festival"
  ]
}' |
apify call lofomachines/instagram-post-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lofomachines/instagram-post-search-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/m6AccXLAcM1fuJWPj/builds/aG2iI3V4mfWgq1Uiv/openapi.json
