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
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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": "« 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 »",
"page": null,
"active": false
}
],
"path": "http://127.0.0.1:8000/api/offers/category/architecto",
"per_page": 12,
"to": null,
"total": 0
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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": "« 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 »",
"page": null,
"active": false
}
],
"path": "http://127.0.0.1:8000/api/offers/location/architecto",
"per_page": 12,
"to": null,
"total": 0
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.