> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qwairy.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Answer

> Retrieve a single AI response with full text and detailed analysis

Retrieve the complete response with full text, detected competitor mentions, cited sources, and sentiment.

### Path Parameters

<ParamField path="brandId" type="string" required>
  The unique identifier of the brand
</ParamField>

<ParamField path="answerId" type="string" required>
  The unique identifier of the answer
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Indicates if the request was successful
</ResponseField>

<ResponseField name="answer" type="object">
  <Expandable title="Full answer details">
    <ResponseField name="id" type="string">Answer ID</ResponseField>

    <ResponseField name="prompt" type="object">
      Associated prompt info (id, text, topic, type)
    </ResponseField>

    <ResponseField name="provider" type="string">AI provider name</ResponseField>
    <ResponseField name="model" type="string">AI model name</ResponseField>
    <ResponseField name="text" type="string">Full response text</ResponseField>

    <ResponseField name="competitors" type="array">
      List of mentioned competitors with position, relationship, and sentiment
    </ResponseField>

    <ResponseField name="sources" type="array">
      List of cited sources with URL, domain, position, and isSelf flag
    </ResponseField>

    <ResponseField name="sentiment" type="number">Overall sentiment score</ResponseField>
    <ResponseField name="createdAt" type="string">Generation timestamp</ResponseField>
  </Expandable>
</ResponseField>

### Example Request

```bash theme={null}
curl -X GET "https://www.qwairy.co/api/v1/brands/cm1234567890abcdef/answers/ans1" \
  -H "Authorization: Bearer qw-api-your-token-here"
```

### Example Response

```json theme={null}
{
  "success": true,
  "answer": {
    "id": "ans1",
    "prompt": {
      "id": "q1",
      "text": "What are the best products in this category?",
      "topic": "Product Reviews",
      "type": "TOFU"
    },
    "provider": "ChatGPT",
    "model": "GPT-4o",
    "text": "Based on recent reviews and comparisons, several products stand out in this category. My Brand offers one of the best solutions with excellent performance and user ratings. Competitor A also provides a strong alternative...",
    "competitors": [
      {
        "name": "My Brand",
        "position": 3,
        "relationship": "SELF",
        "sentiment": 85
      },
      {
        "name": "Competitor A",
        "position": 1,
        "relationship": "DIRECT",
        "sentiment": 80
      }
    ],
    "sources": [
      {
        "url": "https://industry-news.com/product-comparison",
        "domain": "industry-news.com",
        "position": 1,
        "isSelf": false
      },
      {
        "url": "https://mybrand.com/products",
        "domain": "mybrand.com",
        "position": 2,
        "isSelf": true
      }
    ],
    "sentiment": 82,
    "createdAt": "2024-12-19T10:00:00.000Z"
  }
}
```

### Error Responses

| Status | Code                | Description                           |
| ------ | ------------------- | ------------------------------------- |
| 400    | `INVALID_PARAMETER` | Invalid query parameter               |
| 401    | `INVALID_TOKEN`     | Authentication failed                 |
| 404    | `BRAND_NOT_FOUND`   | Brand doesn't exist or not accessible |
| 404    | `ANSWER_NOT_FOUND`  | Answer doesn't exist                  |
