> ## Documentation Index
> Fetch the complete documentation index at: https://docs.import.kopagari.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Compare two listings

> Value two listings, summarise their condition reports, and return a side-by-side buyer recommendation. Cached per URL pair and language.



## OpenAPI

````yaml /openapi.json post /v1/compare
openapi: 3.1.0
info:
  title: Kopagari Import Tax API
  version: 1.0.0
  description: >-
    Estimate Tanzania Revenue Authority (TRA) import duties and full drive-away
    costs for used Japanese vehicles, straight from an auction-site listing URL.


    Give the API a listing URL (BeForward, SBT Japan, SBI/Enhance Auto, or any
    site exposing schema.org data) and it scrapes the vehicle, matches it
    against the TRA vehicle database, calls the official TRA calculator, and
    returns the duty breakdown.


    **Geo-restriction:** the upstream TRA calculator only answers requests from
    Tanzanian IP addresses, so this API must be reached through its production
    host (which is deployed on Tanzanian infrastructure).
servers:
  - url: https://import.kopagari.com
    description: Production
security:
  - bearerAuth: []
  - apiKeyHeader: []
paths:
  /v1/compare:
    post:
      summary: Compare two listings
      description: >-
        Value two listings, summarise their condition reports, and return a
        side-by-side buyer recommendation. Cached per URL pair and language.
      operationId: compare
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompareRequest'
            example:
              url1: https://www.beforward.jp/toyota/vitz/sc111/
              url2: https://www.beforward.jp/toyota/aqua/sc222/
              rate: 2650
              lang: en
      responses:
        '200':
          description: Comparison result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompareResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    CompareRequest:
      type: object
      required:
        - url1
        - url2
      properties:
        url1:
          type: string
          format: uri
        url2:
          type: string
          format: uri
        rate:
          type: number
          default: 2650
          description: USD→TZS exchange rate used in the drive-away comparison.
        lang:
          type: string
          enum:
            - en
            - sw
          default: en
    CompareResponse:
      type: object
      properties:
        car1:
          $ref: '#/components/schemas/EstimateResponse'
        car2:
          $ref: '#/components/schemas/EstimateResponse'
        condReport1:
          type:
            - string
            - 'null'
        condReport2:
          type:
            - string
            - 'null'
        recommendation:
          type: string
          description: Markdown buyer recommendation with a winner and per-car pros/cons.
        cached:
          type: boolean
    EstimateResponse:
      type: object
      properties:
        input:
          type: object
          properties:
            url:
              type: string
              format: uri
        car:
          $ref: '#/components/schemas/Car'
        matched:
          $ref: '#/components/schemas/Matched'
        tax:
          $ref: '#/components/schemas/Tax'
        cached:
          type: boolean
          description: Whether the result was served from cache.
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    Car:
      type: object
      description: Vehicle attributes scraped from the listing.
      properties:
        make:
          type: string
          example: TOYOTA
        model:
          type: string
          example: VITZ
        modelCode:
          type: string
          description: Chassis code, prefix stripped.
          example: SJ5
        rawModelCode:
          type: string
          description: Chassis code as listed.
          example: DBA-SJ5
        version:
          type: string
          description: Trim / grade.
          example: S
        year:
          type: integer
          example: 2017
        engine_cc:
          type: integer
          example: 1490
        fuel:
          type: string
          example: PETROL
        fobPriceUSD:
          type:
            - number
            - 'null'
          description: Vehicle price (FOB) in USD.
          example: 8500
        cfPriceUSD:
          type:
            - number
            - 'null'
          description: Cost & Freight to Dar es Salaam port in USD.
          example: 11234
        images:
          type: array
          items:
            type: string
            format: uri
        conditionReportUrl:
          type:
            - string
            - 'null'
          format: uri
          description: Auction inspection sheet URL, if found.
    Matched:
      type: object
      description: How the scraped vehicle was resolved against the TRA database.
      properties:
        make:
          type: string
          example: TOYOTA
        makeId:
          type: integer
          example: 1500298
        modelBody:
          type: string
          example: VITZ - SJ5 - SEDAN
        matchType:
          type: string
          enum:
            - exact_code
            - llm_fuzzy
          description: >-
            `exact_code` = chassis code uniquely matched a TRA entry.
            `llm_fuzzy` = matched by AI when no code match existed.
        matchReason:
          type: string
        confidence:
          type: string
          enum:
            - high
            - medium
            - low
          description: >-
            high = exact code match, no adjustments. medium = exact match with
            minor adjustments, or fuzzy match with none. low = fuzzy match or
            model/year adjustments were needed.
        adjustments:
          type: array
          items:
            $ref: '#/components/schemas/Adjustment'
        yom:
          type: integer
          description: Year of manufacture used by TRA (may differ from the listed year).
          example: 2017
        country:
          type: string
          example: JAPAN
        fuelType:
          type: string
          example: PETROL
        capacityBand:
          type: string
          example: 1501 - 2000 CC
    Tax:
      type: object
      description: >-
        The TRA tax breakdown. Monetary fields are formatted strings (e.g.
        "2,439.00").
      properties:
        referenceNumber:
          type: string
          example: '25264120160'
        make:
          type: string
        model:
          type: string
        bodyType:
          type: string
          example: SUV
        modelBody:
          type: string
        yom:
          type: integer
        country:
          type: string
        fuelType:
          type: string
        engineCapacity:
          type: string
          example: 1501 - 2000 CC
        cifInUSD:
          type: string
          description: Cost, Insurance & Freight value used by TRA.
          example: 2,439.00
        importDutyInUSD:
          type: string
          example: '609.75'
        exiseDutyInUSD:
          type: string
          example: '152.44'
        exiseDutyDueToAgeInUSD:
          type: string
          description: Additional excise levied on older vehicles.
          example: '914.63'
        vatInUSD:
          type: string
          example: '797.86'
        customProcessingFeeInUSD:
          type: string
          example: '14.63'
        railwayDevLevyInUSD:
          type: string
          example: '48.78'
        indDevLevy:
          type: string
          example: '0.00'
        hivRespLevy:
          type: string
          example: 150,000.00
        totalImportTaxesInUSD:
          type: string
          example: 2,538.08
        totalImportTaxesInTZS:
          type: string
          example: 6,512,672.49
        vehicleRegistrationFeeInTZS:
          type: string
          example: 500,000.00
        totalTaxesInTZS:
          type: string
          example: 7,162,672.49
        quarter:
          type: integer
          example: 4
        year:
          type: integer
          example: 2025
    Adjustment:
      type: object
      description: A field where the resolved TRA value differed from the scraped value.
      properties:
        field:
          type: string
          example: yom
        from:
          description: Scraped value.
        to:
          description: Resolved TRA value.
        reason:
          type: string
          example: TRA has no 2013 entry for this model; using nearest year 1999.
  responses:
    BadRequest:
      description: Invalid or missing parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Invalid or missing API key
    ServerError:
      description: Scraping or TRA lookup failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Send your API key as `Authorization: Bearer <key>`.'
    apiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: Alternatively, send your API key in the `x-api-key` header.

````