Taxonomy API
There are a few ways to perform searches on the Taxonomy API. However, only one is the most correct one. You should filter by the site/marketplace you are looking for, and also, to improve the reading, it's better to also include the category on that search. Look here .
Taxonomy tree
In order to obtain the taxonomy tree for all available categories, you need to execute the following request:
curl -X GET \
'https://api.olxgroup.com/taxonomy/v1/categories/' \
-H "User-Agent: crm_name"
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: your-api-key'
Which will return something like:
{
"transaction_id": "42ab7ba0-660c-11ef-ac5c-cd059a5222d2",
"message": "success",
"data": [
{
"code": "urn:concept:apartments-for-sale",
"label": "Apartments for Sale",
"children": null,
"attributes": [
{
"code": "urn:concept:number-of-rooms",
"label": "Number of Rooms",
"type": "select",
"mandatory": true,
"values": [
{
"code": "urn:concept:1",
"label": "1"
},
{
"code": "urn:concept:2",
"label": "2"
},
{
"code": "urn:concept:3",
"label": "3"
},
{
"code": "urn:concept:4",
"label": "4"
},
{
"code": "urn:concept:5",
"label": "5"
},
{
"code": "urn:concept:6",
"label": "6"
},
{
"code": "urn:concept:7",
"label": "7"
},
{
"code": "urn:concept:8",
"label": "8"
},
{
"code": "urn:concept:9",
"label": "9"
},
{
"code": "urn:concept:more",
"label": "More"
},
{
"code": "urn:concept:10",
"label": "10"
}
]
},
{
"code": "urn:concept:net-area-m2",
"label": "Net Area (m2)",
"type": "input",
"mandatory": true,
"values": []
},
{
"code": "urn:concept:construction-year",
"label": "Construction Year",
"type": "input",
"mandatory": false,
"values": []
}
],
"mandatory": null
}
]
}
In the previous example, we can see a first-level category called "Realestate for Sale". Within it, there's another category (under children
) called "Apartments for Sale". This one has no children, but it does one attribute called Price Negotiable
where you can find a couple of values, "Yes" and "No".
You can use the attribute types to help you decide how to best represent these elements on your front-end. For example, a type select
corresponds directly to an HTML select box.
These are the supported attribute types:
Type | Description |
---|---|
select | Contains a list of values such as "yes" and "no" |
input | Accepts a regular string |
multiple | Contains a list of values but allows multiple selections |
Get a single website
If you want to get the taxonomy tree for a single website, you just need to provide the corresponding site URN in the following request:
curl -X GET \
'https://api.olxgroup.com/taxonomy/v1/categories/partner/urn:site:imovirtualcom' \
-H 'Accept: application/json' \
-H "User-Agent: crm_name"
-H 'Content-Type: application/json' \
-H 'X-API-KEY: <YOUR API KEY>'
Get a single category on a website
By combining the two filters, you can get a specific category on a single website:
curl -X GET \
'https://api.olxgroup.com/taxonomy/v1/categories/partner/urn:site:imovirtualcom/urn:concept:apartments-for-sale' \
-H 'Accept: application/json' \
-H "User-Agent: crm_name"
-H 'Content-Type: application/json' \
-H 'X-API-KEY: <YOUR API KEY>'
And this last one should be the chosen one, to make any request to Taxonomy API.
Updated 2 days ago