# Scraper Annunci Subito.it (`amintouzani/scraper-annunci-subito-it`) Actor

Monitora Subito.it e ricevi notifiche istantanee su Telegram. L'Actor rileva nuovi annunci, evita duplicati e invia schede prodotto leggibili. Ideale per chi cerca affari in tempo reale: facile da configurare, veloce e ottimizzato per non perdere nessuna occasione.

- **URL**: https://apify.com/amintouzani/scraper-annunci-subito-it.md
- **Developed by:** [Amin Touzani](https://apify.com/amintouzani) (community)
- **Categories:** E-commerce, Automation, Real estate
- **Stats:** 3 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Subito.it Telegram Scraper

Questo Actor per la piattaforma Apify ti permette di monitorare in tempo reale qualsiasi ricerca o categoria su Subito.it e ricevere notifiche istantanee direttamente sul tuo smartphone tramite Telegram.

Ideale per trovare al volo affari imperdibili, auto, appartamenti in affitto o oggetti da collezionismo prima di chiunque altro.

---

### Caratteristiche Principali

* Monitoraggio Automatico del Mercato: Riconosce automaticamente il tipo di link inserito e adatta la notifica per mostrarti i dati più importanti (Prezzo, Chilometri, Superficie, ecc.).
* Zero Notifiche Duplicate: Il sistema integra un database interno che memorizza i prodotti già visti. Riceverai una notifica solo per i nuovi annunci reali.
* Layout Notifiche Ottimizzato: Schede ricche di dettagli con link diretto all'annuncio.

---

### Guida alla Configurazione

Per avviare correttamente il monitoraggio, compila i seguenti campi nella sezione **Input** di Apify:

#### 1. URL di Subito.it (`subito_url`)
Inserisci l'URL completo della pagina di ricerca che vuoi monitorare. 
* **Come ottenerlo:** Vai su Subito.it, imposta tutti i filtri desiderati (categoria, prezzo, regione, parole chiave, ecc.) e premi "Cerca". Copia l'indirizzo che appare nella barra del browser.
* **Consiglio:** Più filtri aggiungi, più precisa sarà la ricerca e più rapido sarà l'Actor. Esempio: `https://www.subito.it/annunci-italia/vendita/auto/bmw/?price-max=15000`

#### 2. Telegram Bot Token (`telegram_token`)
Il token è la "chiave" che permette al bot di inviarti i messaggi.
* **Come ottenerlo:** 
  1. Su Telegram, cerca il bot `@BotFather`.
  2. Invia il comando `/newbot` e segui le istruzioni per dare un nome al tuo bot.
  3. BotFather ti fornirà una stringa lunga (es. `123456:ABC-DEF...`). Copiala e incollala interamente.

#### 3. Telegram Chat ID (`telegram_chat_id`)
L'ID serve a indicare al bot la chat (la tua personale) a cui inviare le notifiche.
* **Come ottenerlo:**
  1. Su Telegram, cerca il bot `@userinfobot`.
  2. Avvia la chat premendo `/start`.
  3. Il bot ti risponderà con un codice numerico (es. `123456789`). Copia questo numero e incollalo nel campo dell'Actor.

---

### Output e Dataset
Ogni annuncio trovato viene salvato nel Dataset predefinito dell'Actor. 

* **Dati principali:** ID univoco dell'annuncio, titolo completo, prezzo e data di pubblicazione.
* **Link diretto:** L'URL esatto e pronto all'uso per aprire subito l'inserzione dal browser o dall'app.
* **Dettagli tecnici:** Informazioni aggiuntive che variano automaticamente in base alla categoria monitorata (es. chilometri e anno di immatricolazione per le auto, metri quadri e numero di locali per gli immobili).

---

### Modello di Monetizzazione e Billing

L'Actor utilizza il modello di monetizzazione di Apify "Pay-per-event + usage".

* Costo di Avvio (Actor Start): $0.005 per ogni esecuzione.
* Costo per Risultato (Result): $0.001 per ogni nuovo annuncio salvato nel dataset.
* Protezione Utente: È impostato un Minimum max cost per run di $0.20 per garantire che l'esecuzione abbia budget sufficiente per completare la scansione.

#### Esempi di Costo (Stime)
| Scenario | Risultati Trovati | Costo Totale (Start + Result) |
| :--- | :--- | :--- |
| Prima Run (Popolamento) | 90 | $0.095 |
| Monitoraggio (Mercato vivace) | 20 | $0.025 |
| Monitoraggio (Mercato fermo) | 0 | $0.005 |

Nota: Nelle esecuzioni successive alla prima, il costo dipende esclusivamente dal numero di nuovi annunci pubblicati: se non ci sono novità, il costo sarà pari alla sola quota di avvio di $0.005.

---

### Ciclo di Vita del Monitoraggio

#### La Prima Esecuzione (Popolamento)
Quando avvii l'Actor per la prima volta su un nuovo URL, il sistema esegue un "popolamento". Analizzerà fino a 90 annunci per popolare il database interno.

#### Esecuzioni Successive (Incrementali)
Dalla seconda esecuzione in poi, l'Actor controllerà solo gli annunci pubblicati più recentemente. Il sistema confronterà ogni nuovo annuncio con il database interno: riceverai una notifica Telegram esclusivamente se l'annuncio è nuovo rispetto a quelli rilevati nelle run precedenti.

---

### Consigli d'Uso e Sicurezza

* Filtri Mirati: Ogni run analizza massimo 90 annunci, e li invia solo se sono pubblicati nelle ultime 24 ore. Se monitori categorie troppo ampie (es. "Auto in tutta Italia"), il limite verrà raggiunto subito. Ti consigliamo di applicare filtri su provincia, categoria o prezzo per massimizzare l'efficacia.
* Isolamento Ricerche: Ogni URL inserito è gestito in modo isolato. Se cambi link (case sensitive), l'Actor creerà una nuova sezione di memoria dedicata.
* Ottimizzazione Risorse: L'Actor è progettato per essere estremamente leggero (128MB di RAM sono sufficienti per un'esecuzione ottimale). Per un monitoraggio costante ed efficiente, ti suggeriamo di configurare una "Schedule" su Apify con un intervallo di 15 minuti.
* Frequenza Consigliata: Il bilanciamento ideale tra tempestività e costi di infrastruttura (gestiti direttamente dalla piattaforma Apify) si ottiene con esecuzioni ogni 15-30 minuti. Monitoraggi ultra-frequenti (inferiori ai 5 minuti) aumentano esponenzialmente il consumo di risorse senza apportare vantaggi significativi in termini di velocità di notifica. Ti invitiamo a un uso consapevole e sostenibile del tool.

---

> **Disclaimer: Questo Actor è fornito "così com'è". L'autore non è responsabile per blocchi IP da parte di Subito.it o variazioni strutturali del sito. Assicurati di usare l'Actor nel rispetto dei termini di servizio di Subito.it.

# Actor input Schema

## `subito_url` (type: `string`):

Incolla l'URL completo della pagina di ricerca di Subito.it con i filtri già impostati.
## `telegram_token` (type: `string`):

Il token del bot fornito da @BotFather. Se lasciato vuoto, l'Actor salverà i dati solo nel Dataset di Apify senza inviare notifiche.
## `telegram_chat_id` (type: `string`):

L'ID numerico della chat a cui inviare i messaggi (@userinfobot).

## Actor input object example

```json
{
  "subito_url": "https://www.subito.it/annunci-italia/vendita/informatica/"
}
````

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "subito_url": "https://www.subito.it/annunci-italia/vendita/informatica/"
};

// Run the Actor and wait for it to finish
const run = await client.actor("amintouzani/scraper-annunci-subito-it").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 = { "subito_url": "https://www.subito.it/annunci-italia/vendita/informatica/" }

# Run the Actor and wait for it to finish
run = client.actor("amintouzani/scraper-annunci-subito-it").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "subito_url": "https://www.subito.it/annunci-italia/vendita/informatica/"
}' |
apify call amintouzani/scraper-annunci-subito-it --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=amintouzani/scraper-annunci-subito-it",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Scraper Annunci Subito.it",
        "description": "Monitora Subito.it e ricevi notifiche istantanee su Telegram. L'Actor rileva nuovi annunci, evita duplicati e invia schede prodotto leggibili. Ideale per chi cerca affari in tempo reale: facile da configurare, veloce e ottimizzato per non perdere nessuna occasione.",
        "version": "0.0",
        "x-build-id": "Dudukgkm7QICegFLY"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/amintouzani~scraper-annunci-subito-it/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-amintouzani-scraper-annunci-subito-it",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/amintouzani~scraper-annunci-subito-it/runs": {
            "post": {
                "operationId": "runs-sync-amintouzani-scraper-annunci-subito-it",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/amintouzani~scraper-annunci-subito-it/run-sync": {
            "post": {
                "operationId": "run-sync-amintouzani-scraper-annunci-subito-it",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "subito_url"
                ],
                "properties": {
                    "subito_url": {
                        "title": "URL di ricerca Subito.it",
                        "type": "string",
                        "description": "Incolla l'URL completo della pagina di ricerca di Subito.it con i filtri già impostati."
                    },
                    "telegram_token": {
                        "title": "Telegram Bot Token (Opzionale)",
                        "type": "string",
                        "description": "Il token del bot fornito da @BotFather. Se lasciato vuoto, l'Actor salverà i dati solo nel Dataset di Apify senza inviare notifiche."
                    },
                    "telegram_chat_id": {
                        "title": "Telegram Chat ID (Opzionale)",
                        "type": "string",
                        "description": "L'ID numerico della chat a cui inviare i messaggi (@userinfobot)."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
