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.
Get all categories of a single website
If you want to get the taxonomy tree for a single website, you just need to provide the corresponding Supported sites in the following request:
curl -X GET \
'https://api.olxgroup.com/taxonomy/v1/categories/partner/urn:site:olxro' \
-H 'Accept: application/json' \
-H "User-Agent: crm_name"
-H 'Content-Type: application/json' \
-H 'X-API-KEY: <YOUR API KEY>'
Which will return something like:
{
"transaction_id": "f7dbfde0-1efb-11ed-a082-a3f14ad795dd",
"message": "success",
"data": [
{
"code": "urn:concept:bodywork",
"label": "bodywork",
"children": null,
"attributes": [
{
"code": "urn:concept:stare",
"label": "stare",
"type": "select",
"values": [
{
"code": "urn:concept:noua",
"label": "Noua"
},
{
"code": "urn:concept:second-hand",
"label": "Second Hand"
}
]
},
{
"code": "urn:concept:brand",
"label": "brand",
"type": "select",
"values": [
{
"code": "urn:concept:fiat",
"label": "Fiat"
},
{
"code": "urn:concept:ford",
"label": "Ford"
},
{
"code": "urn:concept:dacia",
"label": "Dacia"
},
{
"code": "urn:concept:hyundai",
"label": "Hyundai"
},
{
"code": "urn:concept:infiniti",
"label": "Infiniti"
},
{
"code": "urn:concept:volkswagen",
"label": "Volkswagen"
},
{
"code": "urn:concept:maserati",
"label": "Maserati"
}
]
},
{
"code": "urn:concept:codul-piesei",
"label": "codul_piesei",
"type": "input",
"values": []
},
{
"code": "urn:concept:marca",
"label": "marca",
"type": "select",
"values": [
{
"code": "urn:concept:fiat",
"label": "Fiat"
},
{
"code": "urn:concept:ford",
"label": "Ford"
},
{
"code": "urn:concept:dacia",
"label": "Dacia"
},
{
"code": "urn:concept:hyundai",
"label": "Hyundai"
},
{
"code": "urn:concept:infiniti",
"label": "Infiniti"
},
{
"code": "urn:concept:volkswagen",
"label": "Volkswagen"
},
{
"code": "urn:concept:maserati",
"label": "Maserati"
}
]
}
]
}
]
}
In the previous example, we can see a first-level category called “bodywork”. This one has no children (if it has, it would be another category), but it has four attributes:
- stare
- brand
- codul_piesei
- marca
Inside these attributes you can find that they can have several values depicted by their codes.
For example, The stare attribute can have the following values:
- urn:concept:noua
- urn:concept:second-hand
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 category by website
By combining the two filters, you can get a specific category from one of the Supported sites
curl -X GET \
'https://api.olxgroup.com/taxonomy/v1/categories/partner/urn:site:olxro/urn:concept:bodywork \
-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.