---
name: "getAnalyzePetFeatureResult"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.6.27" }
title: "getAnalyzePetFeatureResult - Get pet feature analysis results."
---

## getAnalyzePetFeatureResult

> [VERSION] @ray-js/ray >= 1.6.27

### Description

Get pet feature analysis results

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `getAnalyzePetFeatureResultParam` | Yes | Request parameters: taskId Task ID, type Analysis type: 0 Pet features, 1 Food composition, 2 Similarity |

### Return Value

Type: `Promise<Object>`

Promise that resolves to the analysis result (status, features, images, etc.); see type PetFeatureAnalyzeResult
| Property | Type | Description |
| --- | --- | --- |
| `analysisResult` | `0 \| 1 \| 2` | Analysis status: 0 - Loading, 1 - Failed, 2 - Succeeded |
| `petType` | `"cat" \| "dog"` | Pet type: cat, dog |
| `feature` | `Feature[]` | Feature code |
| `images` | `Images[]` | Image analysis result |
| `hasMatch` | `boolean` | Whether a similar one exists |
| `matchedPets` | `Object[]` | Similar pets |
| `name` | `string` | Food composition fields - Brand name |
| `protein` | `string` | Crude protein content |
| `fat` | `string` | Crude fat content |
| `fiber` | `string` | Crude fiber content |

##### result.matchedPets[] properties

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `petId` | `number` | Yes | - | Pet ID |
| `petName` | `string` | Yes | - | Pet name |
| `similarity` | `number` | Yes | - | Similarity |


### Referenced Types

##### `type` getAnalyzePetFeatureResultParam

| Property | Type | Description |
| --- | --- | --- |
| `taskId` | `string` | Task ID |
| `type` | `"0" \| "1" \| "2"` | Type: 0 - pet feature, 1 - food composition, 2 - similarity detection |

##### `type` Feature

| Property | Type | Description |
| --- | --- | --- |
| `category` | `string` |  |
| `details` | `string[]` |  |

##### `type` Images

| Property | Type | Description |
| --- | --- | --- |
| `imageDisplayUrl` | `string` |  |
| `objectKey` | `string` |  |
| `angle` | `string` |  |
| `desc` | `string` |  |


### Examples

#### Request example

```typescript
import { getAnalyzePetFeatureResult } from '@ray-js/ray';

getAnalyzePetFeatureResult({
  taskId: 'xxxx',
  type: '0',
});
```

#### Response example

```json
{
  "analysisResult": 2,
  "features": [
    {
      "category": "eyeColor",
      "details": ["dark brown"]
    }
  ],
  "images": [
    {
      "angle": "firstFront",
      "desc": "xxxxx",
      "objectKey": "xxx"
    }
  ]
}
```
