Skip to content

Instantly share code, notes, and snippets.

@danikarik
Last active September 23, 2021 14:17
Show Gist options
  • Save danikarik/db5835af1fcddc783605ace89eeaa14a to your computer and use it in GitHub Desktop.
Save danikarik/db5835af1fcddc783605ace89eeaa14a to your computer and use it in GitHub Desktop.
Okpock API Overview

Developer documentation for api.okpock.com

This page contains all necessary information to work with API.

Overview

https://api.okpock.com serves 3 endpoints:

  • /info - Returns VIN code and license plate only.
  • /preview - Returns a preview of data like mark, model, registrations and accidents count.
  • /report - Returns a full list of data fields.

Authentication

To be able to access endpoints caller should set basic auth credentials and User-Agent header provided from admin.

Example:

curl --request POST \
  --url https://api.okpock.com/report \
  --header 'Authorization: Basic <your credentials hash>' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: <your user-agent>' \
  --data '{"plate": "A929YLO"}'

Errors

In case if error API returns http response with code (4xx or 5xx) and json payload.

Example:

{
  "system": "OKPOCK",
  "status": 404,
  "message": "not_found",
  "devMessage": "Given plate or VIN not found"
}

Error codes

  • 400 - Invalid json request body | Empty plate or VIN
  • 401 - Missing basic auth credentials | Invalid auth credentials
  • 403 - User agent not allowed or disabled
  • 404 - License plate or VIN not found
  • 406 - Missing required header
  • 500 - Internal server error
  • 501 - Not implemented (due to changed JSON payload)
  • 503 - Service unavailable (due to provider)
  • 504 - Gateway timeout (due to request timeout)

Info endpoint

Request

{
  "plate": "A929YLO"
}

or

{
  "VIN": "JTHBG262282011458"
}

Response

{
  "VIN": "JTHBG262282011458",
  "plate": "A929YLO"
}

Preview endpoint

Request

{
  "plate": "A929YLO"
}

or

{
  "VIN": "JTHBG262282011458"
}

Response

{
  "mark": "LEXUS",
  "model": "IS300",
  "vehicle_year": 2007,
  "registration_actions_found": true,
  "road_accidents_found": false
}

Report endpoint

Request

{
  "plate": "058FUA14"
}

or

{
  "VIN": "WVWZZZ31ZLE147331"
}

Response

{
  "report": {
    "car_info": {
      "vin": "WVWZZZ31ZLE147331",
      "base_info": {
        "engine_volume": 1781,
        "engine_power_kwt": 66,
        "empty_weight": 1160,
        "plated_weight": 1700,
        "manufacturer": "",
        "mark": "VOLKSWAGEN",
        "model": "PASSAT",
        "origin_country": "Германия",
        "seating_count": 5,
        "vehicle_year": 1990,
        "vehicle_age_category": "",
        "vehicle_category": "Легковые автомобили",
        "vehicle_category_wide": "",
        "vehicle_type": "",
        "vehicle_color": "ЦВЕТ НЕОПРЕДЕЛЕН",
        "vehicle_count": 1
      },
      "additional_info": ""
    },
    "registration_history": [
      {
        "action": "ПОСТАНОВКА",
        "address": "ПАВЛОДАРСКАЯ ОБЛАСТЬ, Г.ПАВЛОДАР",
        "person_type": "ФИЗ.ЛИЦО",
        "action_date": "2019-09-01T00:00:00Z"
      },
      {
        "action": "СНЯТИЕ",
        "address": "ПАВЛОДАРСКАЯ ОБЛАСТЬ, Г.ПАВЛОДАР",
        "person_type": "ФИЗ.ЛИЦО",
        "action_date": "2019-08-01T00:00:00Z"
      },
      {
        "action": "ПОСТАНОВКА",
        "address": "",
        "person_type": "ФИЗ.ЛИЦО",
        "action_date": "2013-06-20T00:00:00Z"
      },
      {
        "action": "СНЯТИЕ",
        "address": "",
        "person_type": "ФИЗ.ЛИЦО",
        "action_date": "2013-06-20T00:00:00Z"
      },
      {
        "action": "СНЯТИЕ",
        "address": "",
        "person_type": "ФИЗ.ЛИЦО",
        "action_date": "2013-06-20T00:00:00Z"
      }
    ],
    "road_accidents": [
      {
        "accident_date": "2019-07-23T00:00:00Z",
        "description": "ПЕРЕДНЯЯ ПРААВАЯ СТОРОНА КУЗОВА"
      }
    ]
  },
  "db_updated_at": ""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment