Listings
All listings endpoints.
Listing
Get single listing.
Headers
- Name
Content-Type
- Type
- string
- Description
application/json
- Name
Authorization
- Type
- string
- Description
Beare <token>
Request
curl https://api.olx.ba/listings/:id \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
Response
{
"id": 40,
"type": "single",
"title": "audi a3",
"slug": "audi-a3",
"short_description": "Audi a3",
"additional": {
"description": "opis oglasa"
},
"user": {
"id": 1,
...
},
"price": 11990,
"display_price": "11.990 KM",
"regular_price": 0,
"listing_type": "sell",
"price_by_agreement": false,
"visible": false,
"quantity": 1,
"location": {
"lat": 43.1973791,
"lon": 17.5461833
},
"status": "active",
"available": false,
"state": "used",
"shipping": "no_shipping"
...
}
Create new listing
Create new listing.
Note: Your new listing will have the status DRAFT when you save it. You must publish the listing to make it active.
Publish listingHeaders
- Name
Content-Type
- Type
- string
- Description
application/json
- Name
Authorization
- Type
- string
- Description
Beare <token>
Required attributes
- Name
title
- Type
- string
- Description
Listing title.
Optional attributes
- Name
short_description
- Type
- string
- Description
Short description.
- Name
description
- Type
- string
- Description
Description.
- Name
country_id
- Type
- string
- Description
Country ID ( check Location resources ).
- Name
city_id
- Type
- string
- Description
City ID ( check Location resources ).
- Name
price
- Type
- numeric
- Description
Price
- Name
available
- Type
- boolean
- Description
Available
- Name
listing_type
- Type
- string
- Description
Listing type:
- sell
- buy
- rent
- Name
state
- Type
- string
- Description
- new
- used
- Name
brand_id
- Type
- string
- Description
Brand id ( check Categories resource for brand references )
- Name
model_id
- Type
- string
- Description
Brand id ( check Categories resource for model references )
- Name
sku_number
- Type
- string
- Description
Internal sku number
- Name
attributes
- Type
- array
- Description
To get attributes for category check Categories references. Example of attributes:
Attributes
"attributes" : [ { "id": 2, "value": "2022" // Year }, { "id": 7, "value": "Dizel" // Fuel type }, { "id": 901, "value": "2/3" // Door }, { "id": 3, "value": "50000" // Mileage }, { "id": 1144, "value": "1.5" // Power }, { "id": 5, "value": "55" // Cubic Capacity } ]
Request
curl -X POST https://api.olx.ba/listings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
Response
{
"id": 40,
"type": "single",
"title": "audi a3",
"slug": "audi-a3",
"short_description": "Audi a3",
"additional": {
"description": "opis oglasa"
},
"user": {
"id": 1,
...
},
"price": 11990,
"display_price": "11.990 KM",
"regular_price": 0,
"listing_type": "sell",
"price_by_agreement": false,
"visible": false,
"quantity": 1,
"location": {
"lat": 43.1973791,
"lon": 17.5461833
},
"status": "active",
"available": false,
"state": "used",
"shipping": "no_shipping"
...
}
Update listing
Update single listing.
Headers
- Name
Content-Type
- Type
- string
- Description
application/json
- Name
Authorization
- Type
- string
- Description
Beare <token>
Update request
{
"title": "audi a3",
"description" : "listing description",
"price": 11990
}
Request
curl -X PUT https://api.olx.ba/listings/:id \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
Response
{
"id": 40,
"type": "single",
"title": "audi a3",
"slug": "audi-a3",
"short_description": "Audi a3",
"additional": {
"description": "opis oglasa"
},
"user": {
"id": 1,
...
},
"price": 11990,
"display_price": "11.990 KM",
"regular_price": 0,
"listing_type": "sell",
"price_by_agreement": false,
"visible": false,
"quantity": 1,
"location": {
"lat": 43.1973791,
"lon": 17.5461833
},
"status": "active",
"available": false,
"state": "used",
"shipping": "no_shipping"
...
}
Publish listing
When you save a new listing, it will have the status "DRAFT." In DRAFT status listing is saved but not visible on search. Use this endpoint in order to activate listing.
Headers
- Name
Content-Type
- Type
- string
- Description
application/json
- Name
Authorization
- Type
- string
- Description
Beare <token>
Request
curl -X POST https://api.olx.ba/listings/:id/publish \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
Response
{
"message": "Oglas je uspjesno objavljen",
"status": "active"
}
Delete listing
Delete single listing.
Headers
- Name
Content-Type
- Type
- string
- Description
application/json
- Name
Authorization
- Type
- string
- Description
Beare <token>
Request
curl -X DELETE https://api.olx.ba/listings/:id \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
Response
{
"message": "Uspješno ste izbrisali oglas"
}
Listing refresh limits
Listing refresh limits.
Headers
- Name
Content-Type
- Type
- string
- Description
application/json
- Name
Authorization
- Type
- string
- Description
Beare <token>
Request
curl -X GET https://api.olx.ba/listing/refresh/limits \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
Response
{
"free_limit": 750,
"free_count": 0,
"paid_count": 0,
"listing_count": 3
}
Listing limits
Listing limits.
Headers
- Name
Content-Type
- Type
- string
- Description
application/json
- Name
Authorization
- Type
- string
- Description
Beare <token>
Request
curl -X GET https://api.olx.ba/listing-limits \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
Response
{
"data": {
"cars": {
"limit": 0,
"listings": 0
},
"real-estate": {
"limit": 0,
"listings": 1
},
"other": {
"limit": 0,
"listings": 8
}
}
}
Listing refresh
Refesh listing date. It will boost listing on search rank.
Headers
- Name
Content-Type
- Type
- string
- Description
application/json
- Name
Authorization
- Type
- string
- Description
Beare <token>
Request
curl -X PUT https://api.olx.ba/listings/:id/refresh \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
Response
{
"message": "Artikal je uspjesno obnovljen."
}
Image upload
Headers
- Name
Authorization
- Type
- string
- Description
Beare <token>
Required attributes
- Name
images
- Type
- array<image>
- Description
Image files
Attributes
- Name
image_url
- Type
- string
- Description
Image url
Request
curl -X POST https://api.olx.ba/listings/:id/image-upload \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
Response
[
{
"id": 44,
"name": "img-1679924109-fd89f8c193d2.jpeg",
"main": false,
"order": 0,
"sizes": {
"sm": "listings\/40\/sm\/img-1679924109-fd89f8c193d2.jpeg",
"lg": "listings\/40\/lg\/img-1679924109-fd89f8c193d2.jpeg"
},
"created_at": "2023-03-27T13:35:11.000000Z"
},
{
"id": 45,
"name": "img-1679924111-6249d3519888.jpg",
"main": false,
"order": 0,
"sizes": {
"sm": "listings\/40\/sm\/img-1679924111-6249d3519888.jpg",
"lg": "listings\/40\/lg\/img-1679924111-6249d3519888.jpg"
},
"created_at": "2023-03-27T13:35:12.000000Z"
}
]
Image delete
Delete image from listing. In URL is Listing id and in request you need to send imageId.
Headers
- Name
Content-Type
- Type
- string
- Description
application/json
- Name
Authorization
- Type
- string
- Description
Beare <token>
Required attributes
- Name
imageId
- Type
- integer
- Description
Image ID.
Request
curl -X POST https://api.olx.ba/listings/:id/image-delete \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"imageId":"1"}'
Response
{
"success" : true
}
Image set main
Set main image. In URL is listing ID and in request you need to send imageId.
Headers
- Name
Content-Type
- Type
- string
- Description
application/json
- Name
Authorization
- Type
- string
- Description
Beare <token>
Required attributes
- Name
imageId
- Type
- integer
- Description
Image ID.
Request
curl -X PUT https://api.olx.ba/listings/:id/image-main \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"imageId":"1"}'
Response
{
"success" : true
}
Finish listing
Headers
- Name
Content-Type
- Type
- string
- Description
application/json
- Name
Authorization
- Type
- string
- Description
Beare <token>
Request
curl -X POST https://api.olx.ba/listings/:id/finish \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
Hide listing
Listings that are hidden won't show up in searches. It will appear on your profile in the "hidden" list.
Headers
- Name
Content-Type
- Type
- string
- Description
application/json
- Name
Authorization
- Type
- string
- Description
Beare <token>
Request
curl -X POST https://api.olx.ba/listings/:id/hide \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
Unhide listing
Headers
- Name
Content-Type
- Type
- string
- Description
application/json
- Name
Authorization
- Type
- string
- Description
Beare <token>
Request
curl -X POST https://api.olx.ba/listings/:id/unhide \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \