> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/No-Country-simulation/S02-26-Equipo-33-Web-App/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Horse

> Get a single horse listing by ID with detailed information and latest vet record

## Authentication

Optional - Public endpoint, authentication may provide additional features

## Path Parameters

<ParamField path="id" type="string" required>
  Horse unique identifier (MongoDB ObjectId)
</ParamField>

## Behavior

* Automatically increments view count
* Returns only active listings
* Includes populated seller information
* Returns latest validated vet record if available

## Response

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

<ResponseField name="data" type="object">
  Horse listing details

  <ResponseField name="_id" type="string">
    Horse unique identifier
  </ResponseField>

  <ResponseField name="seller_id" type="object">
    Seller information (populated)

    <ResponseField name="_id" type="string">
      Seller ID
    </ResponseField>

    <ResponseField name="full_name" type="string">
      Seller full name
    </ResponseField>

    <ResponseField name="email" type="string">
      Seller email
    </ResponseField>

    <ResponseField name="phone" type="string">
      Seller phone number
    </ResponseField>

    <ResponseField name="seller_profile" type="object">
      Complete seller profile information
    </ResponseField>
  </ResponseField>

  <ResponseField name="name" type="string">
    Horse name
  </ResponseField>

  <ResponseField name="age" type="number">
    Horse age in years (0-40)
  </ResponseField>

  <ResponseField name="breed" type="string">
    Horse breed
  </ResponseField>

  <ResponseField name="discipline" type="string">
    Primary discipline
  </ResponseField>

  <ResponseField name="pedigree" type="string">
    Pedigree information
  </ResponseField>

  <ResponseField name="location" type="object">
    <ResponseField name="country" type="string" required>
      Country location
    </ResponseField>

    <ResponseField name="region" type="string" required>
      Region/state
    </ResponseField>

    <ResponseField name="city" type="string">
      City
    </ResponseField>

    <ResponseField name="coordinates" type="object">
      <ResponseField name="lat" type="number">
        Latitude
      </ResponseField>

      <ResponseField name="lng" type="number">
        Longitude
      </ResponseField>
    </ResponseField>
  </ResponseField>

  <ResponseField name="price" type="number">
    Listing price (minimum: 0)
  </ResponseField>

  <ResponseField name="currency" type="string">
    Currency code: USD, EUR, ARS, BRL, MXN
  </ResponseField>

  <ResponseField name="photos" type="array">
    Array of photos (minimum 3 required)

    <ResponseField name="_id" type="string">
      Photo ID
    </ResponseField>

    <ResponseField name="url" type="string" required>
      Photo URL
    </ResponseField>

    <ResponseField name="caption" type="string">
      Photo caption
    </ResponseField>

    <ResponseField name="is_cover" type="boolean">
      Whether this is the cover photo
    </ResponseField>

    <ResponseField name="uploaded_at" type="string">
      Upload timestamp
    </ResponseField>
  </ResponseField>

  <ResponseField name="videos" type="array">
    Array of videos

    <ResponseField name="_id" type="string">
      Video ID
    </ResponseField>

    <ResponseField name="url" type="string" required>
      Video URL
    </ResponseField>

    <ResponseField name="embed_url" type="string">
      Auto-generated embed URL for YouTube/Vimeo
    </ResponseField>

    <ResponseField name="video_type" type="string" required>
      Type: training, competition, other
    </ResponseField>

    <ResponseField name="title" type="string">
      Video title
    </ResponseField>

    <ResponseField name="description" type="string">
      Video description
    </ResponseField>

    <ResponseField name="recorded_at" type="string" required>
      Recording date
    </ResponseField>

    <ResponseField name="uploaded_at" type="string">
      Upload timestamp
    </ResponseField>
  </ResponseField>

  <ResponseField name="status" type="string">
    Listing status: active, sold, paused, draft
  </ResponseField>

  <ResponseField name="views_count" type="number">
    Number of views (incremented on each request)
  </ResponseField>

  <ResponseField name="created_at" type="string">
    Creation timestamp
  </ResponseField>

  <ResponseField name="updated_at" type="string">
    Last update timestamp
  </ResponseField>
</ResponseField>

<ResponseField name="vet_record" type="object" nullable>
  Latest validated vet record (null if none available)

  <ResponseField name="_id" type="string">
    Vet record ID
  </ResponseField>

  <ResponseField name="horse_id" type="string">
    Horse ID
  </ResponseField>

  <ResponseField name="review_date" type="string">
    Date of veterinary review
  </ResponseField>

  <ResponseField name="health_status" type="string">
    Overall health status
  </ResponseField>

  <ResponseField name="certificates" type="array">
    Array of certificate documents
  </ResponseField>

  <ResponseField name="vaccines" type="array">
    Array of vaccine records
  </ResponseField>

  <ResponseField name="validation_status" type="string">
    Status: validated (only validated records returned)
  </ResponseField>

  <ResponseField name="notes" type="string">
    Additional notes
  </ResponseField>
</ResponseField>

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.horsetrust.com/api/horses/507f1f77bcf86cd799439011" \
    -H "Content-Type: application/json"
  ```

  ```javascript JavaScript theme={null}
  const horseId = '507f1f77bcf86cd799439011';
  const response = await fetch(`https://api.horsetrust.com/api/horses/${horseId}`, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json'
    }
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  horse_id = '507f1f77bcf86cd799439011'
  response = requests.get(
      f'https://api.horsetrust.com/api/horses/{horse_id}'
  )

  data = response.json()
  print(data)
  ```
</CodeGroup>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "_id": "507f1f77bcf86cd799439011",
      "seller_id": {
        "_id": "507f191e810c19729de860ea",
        "full_name": "John Smith",
        "email": "john@example.com",
        "phone": "+54 11 1234-5678",
        "seller_profile": {
          "is_verified_badge": true,
          "years_experience": 15,
          "specialty": "Show Jumping"
        }
      },
      "name": "Thunder",
      "age": 8,
      "breed": "Thoroughbred",
      "discipline": "Show Jumping",
      "pedigree": "Sire: Storm Cat, Dam: Winning Colors",
      "location": {
        "country": "Argentina",
        "region": "Buenos Aires",
        "city": "San Isidro",
        "coordinates": {
          "lat": -34.4708,
          "lng": -58.5247
        }
      },
      "price": 45000,
      "currency": "USD",
      "photos": [
        {
          "_id": "65f1a2b3c4d5e6f7g8h9i0j1",
          "url": "https://cdn.horsetrust.com/photos/abc123.jpg",
          "caption": "Thunder at competition",
          "is_cover": true,
          "uploaded_at": "2026-03-01T10:00:00Z"
        }
      ],
      "videos": [
        {
          "_id": "65f1a2b3c4d5e6f7g8h9i0j2",
          "url": "https://youtube.com/watch?v=abc123",
          "embed_url": "https://www.youtube.com/embed/abc123",
          "video_type": "competition",
          "title": "Thunder jumping 1.40m",
          "recorded_at": "2026-02-15T00:00:00Z",
          "uploaded_at": "2026-03-01T10:00:00Z"
        }
      ],
      "status": "active",
      "views_count": 235,
      "created_at": "2026-03-01T10:00:00Z",
      "updated_at": "2026-03-05T15:30:00Z"
    },
    "vet_record": {
      "_id": "65f1a2b3c4d5e6f7g8h9i0j3",
      "horse_id": "507f1f77bcf86cd799439011",
      "review_date": "2026-02-20T00:00:00Z",
      "health_status": "Excellent condition",
      "certificates": [
        {
          "_id": "65f1a2b3c4d5e6f7g8h9i0j4",
          "url": "https://cdn.horsetrust.com/certs/health_cert.pdf",
          "title": "Health Certificate",
          "uploaded_at": "2026-02-20T10:00:00Z"
        }
      ],
      "vaccines": [
        {
          "name": "Influenza",
          "applied_at": "2026-01-15T00:00:00Z",
          "next_due_at": "2026-07-15T00:00:00Z",
          "batch_number": "FLU2026-A123"
        }
      ],
      "validation_status": "validated",
      "notes": "Annual check-up completed. Horse in excellent health."
    }
  }
  ```
</ResponseExample>

## Error Responses

### 400 - Invalid Horse ID

```json theme={null}
{
  "success": false,
  "message": "Invalid horse ID"
}
```

### 404 - Horse Not Found

```json theme={null}
{
  "success": false,
  "message": "Horse not found"
}
```

### 500 - Server Error

```json theme={null}
{
  "success": false,
  "message": "Server error"
}
```
