DocsGuidesKeep a copy in sync

Keep a copy in sync

Import everything once, then keep your copy current with two requests every hour.

  1. 1

    Import once

    Page through /cars and store every vehicle by its ID.

  2. 2

    Update every hour

    Ask /cars?minutes=60 for vehicles changed in the last hour and update them.

  3. 3

    Retire what left

    Ask /archived-lots?minutes=60 and mark those lots sold or removed.

    cURL
    # Every hour: vehicles changed in the last 60 minutes
    curl "https://motorapis.com/api/cars?minutes=60&per_page=50&page=1" \
      -H "x-api-key: YOUR_API_KEY"
    
    # ...and lots archived (sold or removed) in the same window
    curl "https://motorapis.com/api/archived-lots?minutes=60&simple_paginate=1" \
      -H "x-api-key: YOUR_API_KEY"