Skip to content

CSV Duplicate Viewer API

Overview

Find duplicate content in CSV input. Body mode processes text synchronously; URL and file modes submit an asynchronous job.

Endpoint

POST https://api.apidatatools.com/csv-view-duplicates-api

Authentication

Include your API key in the x-api-key header with every request.

Input modes

Mode Processing Description
body Synchronous Send the CSV content as raw text in the request body.
url Asynchronous Send a JSON object containing a URL to the input file.
file Asynchronous Send a JSON object containing the exact storage key returned by the upload workflow.

Headers

Header names are case-insensitive. Use the lowercase spellings shown here.

Header Type Required Default / values Description
x-api-key String Yes — API key used to authenticate the request.
x-source-type String No Default: body. Values: body, url, file. Selects the input mode.

Accepted file extensions

URL and file modes accept .txt, .csv, and .log files.

Request body

Body mode

Send the CSV content as raw text. For example:

name,category
Alpha,one
Beta,two
Alpha,one

Body-size limits depend on your plan. See tool limits.

URL mode

Send a JSON object with a url value:

{
  "url": "https://example.com/input.csv"
}

The URL must be reachable and use HTTP or HTTPS. The file must have an accepted extension.

File mode

Send a JSON object with a file value containing the exact storage key returned by the upload workflow:

{
  "file": "S3_KEY_RETURNED_BY_THE_UPLOAD_WORKFLOW"
}

The file must be available and have an accepted extension.

curl examples

Body mode

curl --request POST \
  --url "https://api.apidatatools.com/csv-view-duplicates-api" \
  --header "x-api-key: YOUR_API_KEY" \
  --data-binary $'name,category\nAlpha,one\nBeta,two\nAlpha,one\n'

URL mode

curl --request POST \
  --url "https://api.apidatatools.com/csv-view-duplicates-api" \
  --header "x-api-key: YOUR_API_KEY" \
  --header "x-source-type: url" \
  --data-raw '{"url":"https://example.com/input.csv"}'

File mode

curl --request POST \
  --url "https://api.apidatatools.com/csv-view-duplicates-api" \
  --header "x-api-key: YOUR_API_KEY" \
  --header "x-source-type: file" \
  --data-raw '{"file":"S3_KEY_RETURNED_BY_THE_UPLOAD_WORKFLOW"}'

Success responses

Synchronous body mode

A successful data-producing response has HTTP 200 and includes request_id, status, and preview. The preview value is serialized JSON.

{
  "request_id": "REQUEST_ID",
  "status": "success",
  "preview": "SERIALIZED_JSON_RESULT"
}

URL and file modes

A successfully accepted asynchronous request has HTTP 202:

{
  "status": "accepted",
  "job_id": "JOB_ID",
  "status_url": "https://api.apidatatools.com/jobs/JOB_ID",
  "request_id": "REQUEST_ID"
}

Async job status

Poll the status URL returned when the job is accepted:

GET https://api.apidatatools.com/jobs/{job_id}

Include x-api-key on the status request. A successful status lookup returns HTTP 200.

Queued

{
  "request_id": "REQUEST_ID",
  "job_id": "JOB_ID",
  "status": "queued",
  "created_at": 0,
  "updated_at": 0,
  "message": "Your job is being processed.",
  "retry_after": 2
}

Processing

{
  "request_id": "REQUEST_ID",
  "job_id": "JOB_ID",
  "status": "processing",
  "created_at": 0,
  "updated_at": 0,
  "message": "Your job is being processed.",
  "retry_after": 2
}

Success

{
  "request_id": "REQUEST_ID",
  "job_id": "JOB_ID",
  "status": "success",
  "created_at": 0,
  "updated_at": 0,
  "result": {
    "status": "success",
    "file": "TEMPORARY_DOWNLOAD_URL",
    "preview": "RESULT_PREVIEW"
  }
}

Failed

{
  "request_id": "REQUEST_ID",
  "job_id": "JOB_ID",
  "status": "failed",
  "created_at": 0,
  "updated_at": 0,
  "error": {
    "code": "ERROR_CODE",
    "message": "Error message",
    "details": {
      "message": "Error message"
    }
  }
}

The failed-job error.details object may include additional details.

Error handling

Errors use this envelope. details may contain additional fields.

{
  "status": "error",
  "error": "ERROR_CODE",
  "request_id": "REQUEST_ID",
  "details": {
    "message": "Error message"
  }
}
HTTP status Error codes When it applies
400 INVALID_SOURCE_TYPE, INVALID_BODY_ENCODING, EMPTY_BODY, INVALID_BODY, INVALID_URL, URL_UNREACHABLE, URL_NOT_OK, INVALID_FILE, FILE_UNAVAILABLE, INVALID_FILE_EXTENSION, INVALID_JOB_ID, JOB_NOT_FOUND, FORBIDDEN, DDB_ERROR Invalid source type or request body; invalid, unreachable, or unsuccessful URL; invalid, unavailable, or unsupported file; or a status lookup error.
401 UNAUTHORIZED The request is not authenticated.
404 USER_NOT_FOUND, UNKNOWN_FUNCTION The authenticated user or requested API endpoint is not found.
429 QUOTA_EXCEEDED, RATE_LIMITED A plan quota or rate limit is exceeded.
413 PAYLOAD_TOO_LARGE, FILE_TOO_LARGE The request body or input file exceeds the applicable plan limit.
500 PLAN_NOT_FOUND, INTERNAL_ERROR, CONFIG_ERROR, PLAN_CONFIG_ERROR Plan configuration is unavailable, asynchronous job configuration is invalid, or an internal processing error occurs.

Processing failures such as DOWNLOAD_FAILED and UPLOAD_FAILED are reported through the job status response with status: "failed"; they are not synchronous HTTP errors from the original accepted request.

Notes

  • Body-size, file-size, quota, and rate limits depend on your plan. See tool limits.
  • Download URLs are temporary, and their retention period depends on your plan.
  • URL and file modes require a JSON request body; body mode requires raw text.