Skip to main content
GET
/
api
/
recommendations
/
history
Recommendation History
curl --request GET \
  --url https://api.example.com/api/recommendations/history
{
  "success": true,
  "data": [
    {
      "recommendation_id": 123,
      "terrain_name": "<string>",
      "tractor_name": "<string>",
      "implement_name": "<string>",
      "compatibility_score": 123,
      "work_type": "<string>",
      "recommendation_date": "<string>"
    }
  ],
  "pagination": {
    "currentPage": 123,
    "totalPages": 123,
    "totalItems": 123,
    "itemsPerPage": 123
  }
}

Overview

Retrieves the recommendation history for the authenticated user with pagination support. Results are cached for 1 hour.
This endpoint only returns recommendations generated by the authenticated user.

Authentication

Required: Bearer token in Authorization header
Authorization: Bearer <your_jwt_token>

Query Parameters

page
integer
default:"1"
Page number for pagination
limit
integer
default:"10"
Number of results per page (max 100)

Response

success
boolean
Indicates if the request was successful
data
array
Array of recommendation records
pagination
object
Pagination metadata

Examples

curl -X GET "http://localhost:4000/api/recommendations/history?page=1&limit=10" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json"

Response Example (200 OK)

{
  "success": true,
  "data": [
    {
      "recommendation_id": 15,
      "terrain_name": "Highland Farm North",
      "tractor_name": "New Holland T6.175",
      "implement_name": "3-body disc plow",
      "compatibility_score": 87.5,
      "work_type": "tillage",
      "recommendation_date": "2026-03-10T15:30:00.000Z"
    },
    {
      "recommendation_id": 14,
      "terrain_name": "Valley Field 3",
      "tractor_name": "John Deere 6130M",
      "implement_name": "Disc harrow",
      "compatibility_score": 92.0,
      "work_type": "tillage",
      "recommendation_date": "2026-03-09T10:15:00.000Z"
    }
  ],
  "pagination": {
    "currentPage": 1,
    "totalPages": 2,
    "totalItems": 12,
    "itemsPerPage": 10
  }
}

Error Responses

Status CodeDescription
401Missing or invalid authentication token
500Internal server error

Caching

Responses are cached for 1 hour (3600 seconds) to improve performance. Recent recommendations may take up to an hour to appear in the history.

Generate Recommendation

Generate new tractor recommendations

Get Recommendation

Get detailed recommendation by ID

Source Code Reference

  • Route: src/routes/recommendation.routes.js:216
  • Controller: src/controllers/recommendationController.js:getRecommendationHistory

Build docs developers (and LLMs) love