Families

GET
https://api.prezo.es/public/v1/families

The family tree as a flat, unpaginated list: Prezo's and the business's own. root tells which root each one hangs from.

参数

此端点不接受参数。

请求示例

import os

import requests

response = requests.get(
    "https://api.prezo.es/public/v1/families",
    headers={
        "Authorization": f"Bearer {os.environ['PREZO_API_KEY']}",
        "Accept": "application/json",
    },
)

print(response.json())

响应

Successful response.

{
  "data": [
    {
      "id": 254,
      "name": "Alimentación",
      "parent": null,
      "root": "food"
    },
    {
      "id": 3101,
      "name": "Verduras",
      "parent": {
        "id": 254,
        "name": "Alimentación"
      },
      "root": "food"
    },
    {
      "id": 3102,
      "name": "Hojas",
      "parent": {
        "id": 3101,
        "name": "Verduras"
      },
      "root": "food"
    },
    {
      "id": 255,
      "name": "Bebidas",
      "parent": null,
      "root": "drink"
    }
  ]
}