# Nepremicnine.net - Spider (`potocnik-jure/nepremicnine---actor`)

Spider vam omogoča pridobivanje ponudb s spletne strani Nepremicnine.net. Trenutno omogoča pridobivanje podatkov z različnih "browse" strani, kjer so uporabljeni filtri. V prihodnosti bo omogočeno tudi pridobivanje podrobnih podatkov s strani posameznih objavljenih nepremičnin.

- **URL**: https://beta-securitybyobscurity.apify.com/potocnik-jure/nepremicnine---actor.md
- **Developed by:** [Jure](https://beta-securitybyobscurity.apify.com/potocnik-jure) (community)
- **Categories:** Real estate
- **Stats:** 8 total users, 2 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.
You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

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

# README

## Nepremicnine.net Crawler - Spider Offers

### Overview

The Nepremicnine.net Crawler is an Apify actor designed to scrape real estate listings from [Nepremicnine.net](https://www.nepremicnine.net), one of the most popular real estate portals in Slovenia. This actor allows you to extract detailed information about properties, including their location, price, description, and more. The data is scraped from browse pages, which are pages with filters applied to refine the search results on the website.

### Features

- **Scrape Property Listings:** Get detailed information on real estate offers, including title, link, price, subtitle, and base URL.
- **Support for Multiple Browse Pages:** You can provide multiple browse page URLs as input to scrape listings from different search filters.
- **Stealth Mode Enabled:** The actor operates in stealth mode to avoid detection and ensure smooth data extraction.

### Getting Started

#### Prerequisites

Before running the Nepremicnine.net Crawler, ensure that you have an Apify account. You can run this actor directly on the Apify platform.

#### Input Schema

The actor requires `startUrls`, which are the URLs of the browse pages on Nepremicnine.net. These pages should include the filters you want to apply to your search. For example, you might filter by location, price range, or property type.

#### Example Input

```json
{
  "startUrls": [
    "https://www.nepremicnine.net/oglasi-prodaja/ljubljana-mesto/stanovanje/",
    "https://www.nepremicnine.net/oglasi-prodaja/ljubljana-okolica/kamnik/hisa/samostojna/",
    "https://www.nepremicnine.net/oglasi-prodaja/ljubljana-okolica/kamnik/hisa/samostojna/?last=7"
  ]
}
```

- **`startUrls`:** A list of URLs pointing to the browse pages of Nepremicnine.net that you want to scrape. These URLs should have the desired filters applied.

#### How to Run

You can run the Nepremicnine.net Crawler on the Apify platform.

##### Running on Apify Platform

1. Go to the Apify platform and find the Nepremicnine.net Crawler actor.
2. Click on the "Run" button.
3. In the input configuration, provide your `startUrls`.
4. Click "Start" to begin the scraping process.

#### Output Schema

The actor outputs a JSON object with the following structure:

```json
{
  "title": "GOLO",
  "link": "https://www.nepremicnine.net/oglasi-prodaja/golo-hisa_6828156/",
  "price": "390.000,00 €",
  "subtitle": "Prodaja: Hiša, Samostojna",
  "baseUrl": "https://www.nepremicnine.net/oglasi-prodaja/ljubljana-okolica/hisa/samostojna/cena-do-450000-eur,velikost-od-150-m2/"
}
```

- **`title`:** The title of the property listing.
- **`link`:** The URL to the detailed property listing page.
- **`price`:** The price of the property.
- **`subtitle`:** Additional information about the property (e.g., number of rooms, bathrooms).
- **`baseUrl`:** The base URL of the website.

#### Customization

If you need to customize the crawler, such as adding more fields to the output or adjusting the scraping logic, you can contact us, to implement it for you.

#### Example Use Case

You might use this actor if you're a real estate investor looking to monitor property listings in specific areas of Slovenia. By providing browse page URLs with your desired filters, you can automate the process of collecting and analyzing real estate data.

### Troubleshooting

- **No Data Returned:** Ensure that the `startUrls` are correct and point to active browse pages on Nepremicnine.net.
- **Rate Limiting Issues:** If you encounter rate limiting, consider adjusting the actor's settings to include delays between requests or reducing the number of concurrent pages.

# Actor input Schema

## `startUrls` (type: `array`):

List of URLs to crawl offers.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.nepremicnine.net/oglasi-prodaja/ljubljana-okolica/hisa/samostojna/cena-do-350000-eur,letnik-od-1970/"
    }
  ]
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://www.nepremicnine.net/oglasi-prodaja/ljubljana-okolica/hisa/samostojna/cena-do-350000-eur,letnik-od-1970/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("potocnik-jure/nepremicnine---actor").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 = { "startUrls": [{ "url": "https://www.nepremicnine.net/oglasi-prodaja/ljubljana-okolica/hisa/samostojna/cena-do-350000-eur,letnik-od-1970/" }] }

# Run the Actor and wait for it to finish
run = client.actor("potocnik-jure/nepremicnine---actor").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 '{
  "startUrls": [
    {
      "url": "https://www.nepremicnine.net/oglasi-prodaja/ljubljana-okolica/hisa/samostojna/cena-do-350000-eur,letnik-od-1970/"
    }
  ]
}' |
apify call potocnik-jure/nepremicnine---actor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=potocnik-jure/nepremicnine---actor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Nepremicnine.net - Spider",
        "description": "Spider vam omogoča pridobivanje ponudb s spletne strani Nepremicnine.net. Trenutno omogoča pridobivanje podatkov z različnih \"browse\" strani, kjer so uporabljeni filtri. V prihodnosti bo omogočeno tudi pridobivanje podrobnih podatkov s strani posameznih objavljenih nepremičnin.",
        "version": "0.0",
        "x-build-id": "Gi17hO8P7Y3trnVXW"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/potocnik-jure~nepremicnine---actor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-potocnik-jure-nepremicnine---actor",
                "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/potocnik-jure~nepremicnine---actor/runs": {
            "post": {
                "operationId": "runs-sync-potocnik-jure-nepremicnine---actor",
                "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/potocnik-jure~nepremicnine---actor/run-sync": {
            "post": {
                "operationId": "run-sync-potocnik-jure-nepremicnine---actor",
                "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": [
                    "startUrls"
                ],
                "properties": {
                    "startUrls": {
                        "title": "Start URLs",
                        "type": "array",
                        "description": "List of URLs to crawl offers.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
