# GET /cheeses/{cheeseId}

Get cheese by ID

Returns detailed information about a specific cheese, including its category, tags, and current availability status.

Authentication (security requirement alternatives):

```json
[
  {
    "api_key": []
  }
]
```

- api_key: apiKey, header X-API-Key. API key authentication. Include your API key in the `X-API-Key` header.

This is an example scheme. Supply credentials from your own service when adapting this contract.


Parameters:

- `cheeseId` (path, integer, int64, required) - Unique identifier for the cheese
  Type: integer, int64
  
  minimum: 1

Responses:

- 200: Cheese details

Content type: application/json

Type: object

Schema: [Cheese](https://sourcey.com/examples/docs-showcase/api/schemas/cheese-6e5a59d4fd.md)

- `id` (required)
  Type: integer, int64
  
  Unique identifier
  
  Example:
  
  ```json
  42
  ```

- `name` (required)
  Type: string
  
  Name of the cheese
  
  minLength: 1
  
  maxLength: 100
  
  Example:
  
  ```json
  "Gorgonzola"
  ```

- `category` (optional)
  Reference: [Category](https://sourcey.com/examples/docs-showcase/api/schemas/category-292c06f004.md); Type: object

- `photoUrls` (optional)
  Type: array
  
  URLs of cheese photos
  
  Example:
  
  ```json
  [
    "https://wannabechef.com/gorgonzola.jpg"
  ]
  ```
  
  Items:
    Type: string, uri

- `tags` (optional)
  Type: array
  
  Classification tags
  
  Items:
    Reference: [Tag](https://sourcey.com/examples/docs-showcase/api/schemas/tag-1503916a2a.md); Type: object

- `status` (required)
  Type: string
  
  Availability status in the store
  
  enum: ["available","pending","sold"]
  
  Example:
  
  ```json
  "available"
  ```

- `origin` (optional)
  Type: string; nullable
  
  Country of origin (null if unknown)
  
  Example:
  
  ```json
  "Italy"
  ```

- `pricePerKg` (optional)
  Type: number, float
  
  Price per kilogram in USD
  
  minimum: 0
  
  exclusiveMinimum: true
  
  Example:
  
  ```json
  28.5
  ```

- `ageMonths` (optional)
  Type: integer
  
  Aging period in months
  
  minimum: 0
  
  maximum: 120
  
  Example:
  
  ```json
  12
  ```

- `organic` (optional)
  Type: boolean
  
  Whether the cheese is certified organic
  
  default: false

- `createdAt` (optional)
  Type: string, date-time
  
  When the cheese was added to the store

- `updatedAt` (optional)
  Type: string, date-time
  
  When the cheese was last updated

```json
{
  "id": 42,
  "name": "Gorgonzola",
  "category": {
    "id": 1,
    "name": "Italian Cheese"
  },
  "status": "available",
  "photoUrls": [
    "https://wannabechef.com/gorgonzola.jpg"
  ],
  "tags": [
    {
      "id": 1,
      "name": "blue"
    },
    {
      "id": 2,
      "name": "italian"
    }
  ]
}
```

- 404: The requested resource was not found

Content type: application/json

Type: object

Schema: [Error](https://sourcey.com/examples/docs-showcase/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

```json
{
  "code": 404,
  "type": "Not found",
  "message": "Your cheese has already been eaten"
}
```

## Examples

### cURL

```bash
curl -X GET 'https://cheese.example.com/v2/cheeses/{cheeseId}'
```

### TypeScript

```typescript
const response = await fetch('https://cheese.example.com/v2/cheeses/{cheeseId}', {
  method: 'GET',
});

const data: Record<string, unknown> = await response.json();
```

### Python

```python
import requests

response = requests.get('https://cheese.example.com/v2/cheeses/{cheeseId}')
data = response.json()
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
)

func main() {
  req, _ := http.NewRequest("GET", "https://cheese.example.com/v2/cheeses/{cheeseId}", nil)
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let response = client.get("https://cheese.example.com/v2/cheeses/{cheeseId}")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```
