Breed library lookup
GET
/pets/pet-infoQueries the platform's standard breed library. Use it to obtain the valid breed_code values for pet profiles and the display name of a breed in the requested language (the same value returned as breed_display_name in profile responses).
pets_type is not the profile pet_type
The breed-library pets_type accepts the strings cat / dog, while writing a pet profile uses the numeric pet_type (1 cat, 2 dog, 3 exotic). Map between them in your own code; they are not interchangeable.
Request URL
text
GET https://open-api.habitaxx.com/v1/ms-ai-fast/pets/pet-info?pets_type=dog&is_sort=1&locale=zh-CNRequest headers
http
Authorization: Bearer <ACCESS_TOKEN>Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
pets_type | string | Yes | — | Only cat or dog; any other value returns 422. |
is_sort | integer | No | 0 | 0 returns an object grouped by first letter, 1 returns a flat array; other values return 422. |
locale | string | No | zh-CN | Display language; affects display_name and returns 400 when not enabled. |
Response example: grouped by first letter (is_sort=0)
json
{
"code": 200,
"message": "success",
"data": {
"locale": "zh-CN",
"items": {
"A": [
{ "breed_code": "cat.egyptian-mau", "display_name": "埃及猫" }
],
"B": [
{ "breed_code": "cat.ragdoll", "display_name": "布偶猫" }
]
},
"featured_items": [
{
"breed_code": "cat.ragdoll",
"display_name": "布偶猫",
"image_url": "https://upload.suoweilai.com/pets_image/buoumao.png"
}
]
}
}Response example: flat array (is_sort=1)
json
{
"code": 200,
"message": "success",
"data": {
"locale": "zh-CN",
"items": [
{ "breed_code": "dog.irish-wolfhound", "display_name": "爱尔兰猎狼犬" },
{ "breed_code": "dog.irish-setter", "display_name": "爱尔兰雪达犬" },
{ "breed_code": "dog.shiba-inu", "display_name": "柴犬" }
],
"featured_items": [
{
"breed_code": "dog.shiba-inu",
"display_name": "柴犬",
"image_url": "https://upload.suoweilai.com/pets_image/chaiqvan.png"
}
]
}
}Response fields
| Field | Type | Description |
|---|---|---|
locale | string | Language actually used for this response. |
items | object | array | Breed catalogue: an object of "first letter → breed array" when is_sort=0, an array when is_sort=1. |
items[].breed_code | string | Stable breed code such as dog.shiba-inu. Use this value when writing a pet profile. |
items[].display_name | string | Display name of the breed in the requested language. |
featured_items | array | Featured breeds. |
featured_items[].breed_code | string | Featured breed code. |
featured_items[].display_name | string | Featured breed display name. |
featured_items[].image_url | string | Featured breed image URL. |
Common errors
HTTP / code | message | Trigger |
|---|---|---|
422 | Input should be 'cat' or 'dog' | pets_type has any other value. |
422 | Input should be less than or equal to 1 | is_sort is outside 0-1. |
400 | 语言尚未启用: <lang> | locale is not enabled in this environment; check GET /locales first. |
Usage notes
breed_codeis a stable code (prefixed withcat.ordog.) that never changes with language; only the display name followslocale.- When creating or updating a pet profile, the
pet_typeand thebreed_codeprefix must match:pet_type=1(cat) usescat.*andpet_type=2(dog) usesdog.*, otherwise the API returns400 宠物品种与宠物类型不一致; an unknown code returns400 宠物品种编码不存在. - Exotic pets (
pet_type=3) have no breed-library data; send the free-textpet_varietyonly. - Measured volume: about 96 dog entries with
is_sort=1, and about 18 first-letter groups for cats.