MENU navbar-image

Introduction

API dla portalu nieruchomości REZYDENT. Umożliwia pobieranie ofert, kategorii i statystyk.

Witaj w dokumentacji API portalu REZYDENT Nieruchomości! 🏠

To API umożliwia:
- 📋 Pobieranie listy ofert z filtrowaniem i paginacją
- 🏡 Szczegóły pojedynczych nieruchomości
- 📂 Zarządzanie kategoriami
- 📊 Statystyki portalu

<aside>Po prawej stronie znajdziesz przykłady kodu w różnych językach programowania. 
Możesz przełączać między językami używając zakładek w prawym górnym rogu.</aside>

Authenticating requests

This API is not authenticated.

Categories

API endpoints for managing property categories

Get categories list

Retrieve all available property categories.

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/categories" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/categories"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 1,
            "name": "Mieszkania",
            "slug": "mieszkania",
            "description": null
        },
        {
            "id": 2,
            "name": "Domy",
            "slug": "domy",
            "description": null
        }
    ]
}
 

Request      

GET api/categories

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Endpoints

GET api/user

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/user" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/user"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/user

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

POST api/inquiries

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/inquiries" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"offer_id\": \"architecto\",
    \"name\": \"n\",
    \"email\": \"ashly64@example.com\",
    \"phone\": \"vdljnikhwaykcmyu\",
    \"subject\": \"w\",
    \"message\": \"architecto\",
    \"inquiry_type\": \"viewing\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/inquiries"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "offer_id": "architecto",
    "name": "n",
    "email": "ashly64@example.com",
    "phone": "vdljnikhwaykcmyu",
    "subject": "w",
    "message": "architecto",
    "inquiry_type": "viewing"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/inquiries

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

offer_id   string   

The id of an existing record in the offers table. Example: architecto

name   string   

Must not be greater than 255 characters. Example: n

email   string   

Must be a valid email address. Must not be greater than 255 characters. Example: ashly64@example.com

phone   string  optional  

Must not be greater than 20 characters. Example: vdljnikhwaykcmyu

subject   string  optional  

Must not be greater than 255 characters. Example: w

message   string   

Example: architecto

inquiry_type   string  optional  

Example: viewing

Must be one of:
  • general
  • viewing
  • offer_info
  • contact
form_data   object  optional  

Offers

API endpoints for managing real estate offers

Get offers list

Retrieve a paginated list of active real estate offers with optional filtering.

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/offers?per_page=12&page=1&category=1&city=Katowice&min_price=100000&max_price=500000&min_area=50&max_area=150&rooms=3&sort_by=cena&sort_order=asc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/offers"
);

const params = {
    "per_page": "12",
    "page": "1",
    "category": "1",
    "city": "Katowice",
    "min_price": "100000",
    "max_price": "500000",
    "min_area": "50",
    "max_area": "150",
    "rooms": "3",
    "sort_by": "cena",
    "sort_order": "asc",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 1,
            "numer_oferty": "01-S-001",
            "title": null,
            "description": "Beautiful apartment in city center",
            "price": {
                "amount": "380762.00",
                "currency": "PLN",
                "per_meter": null
            },
            "location": {
                "city": "Katowice",
                "district": "Centrum",
                "street": "Testowa",
                "postal_code": "40-001"
            },
            "agent": {
                "id": 2,
                "name": "Piotr Nowak",
                "email": "piotr@example.com",
                "phone": "+48 600 200 300"
            }
        }
    ],
    "meta": {
        "current_page": 1,
        "total": 12,
        "per_page": 12
    }
}
 

Request      

GET api/offers

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

per_page   integer  optional  

Number of offers per page. Default: 12. Example: 12

page   integer  optional  

Page number. Example: 1

category   integer  optional  

Category ID to filter by. Example: 1

city   string  optional  

City name to filter by. Example: Katowice

min_price   number  optional  

Minimum price filter. Example: 100000

max_price   number  optional  

Maximum price filter. Example: 500000

min_area   number  optional  

Minimum area filter (m²). Example: 50

max_area   number  optional  

Maximum area filter (m²). Example: 150

rooms   integer  optional  

Number of rooms filter. Example: 3

sort_by   string  optional  

Sort field. Default: data_zalozenia. Example: cena

sort_order   string  optional  

Sort direction (asc/desc). Default: desc. Example: asc

Get offer details

Retrieve detailed information about a specific real estate offer.

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/offers/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/offers/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": 1,
        "numer_oferty": "01-S-001",
        "title": null,
        "description": "Beautiful apartment in city center",
        "price": {
            "amount": "380762.00",
            "currency": "PLN",
            "per_meter": null
        },
        "location": {
            "city": "Katowice",
            "district": "Centrum",
            "street": "Testowa",
            "postal_code": "40-001"
        },
        "details": {
            "area": "90.00",
            "rooms": 3,
            "floor": 2,
            "total_floors": 8
        },
        "agent": {
            "id": 2,
            "name": "Piotr Nowak",
            "email": "piotr@example.com",
            "phone": "+48 600 200 300"
        },
        "category": {
            "id": 1,
            "name": "Mieszkania",
            "slug": "mieszkania"
        }
    }
}
 

Example response (404):


{
    "message": "No query results for model [App\\Models\\Offer] 999"
}
 

Request      

GET api/offers/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the offer. Example: 1

Get offers by category

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/offers/category/architecto" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/offers/category/architecto"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [],
    "links": {
        "first": "http://127.0.0.1:8000/api/offers/category/architecto?page=1",
        "last": "http://127.0.0.1:8000/api/offers/category/architecto?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": null,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "page": null,
                "active": false
            },
            {
                "url": "http://127.0.0.1:8000/api/offers/category/architecto?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "http://127.0.0.1:8000/api/offers/category/architecto",
        "per_page": 12,
        "to": null,
        "total": 0
    }
}
 

Request      

GET api/offers/category/{category}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

category   string   

The category. Example: architecto

Get offers by location

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/offers/location/architecto" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/offers/location/architecto"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [],
    "links": {
        "first": "http://127.0.0.1:8000/api/offers/location/architecto?page=1",
        "last": "http://127.0.0.1:8000/api/offers/location/architecto?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": null,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "page": null,
                "active": false
            },
            {
                "url": "http://127.0.0.1:8000/api/offers/location/architecto?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "http://127.0.0.1:8000/api/offers/location/architecto",
        "per_page": 12,
        "to": null,
        "total": 0
    }
}
 

Request      

GET api/offers/location/{location}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

location   string   

The location. Example: architecto

Get portal statistics

Retrieve general statistics about the real estate portal.

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/stats" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/stats"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "total_offers": 12,
    "featured_offers": 0,
    "categories": [
        {
            "id": 1,
            "name": "Mieszkania",
            "offers_count": 2
        },
        {
            "id": 2,
            "name": "Domy",
            "offers_count": 2
        }
    ]
}
 

Request      

GET api/stats

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json