REST JSON API

Cross API

This API returns cross-reference results by article from Database 1, Database 2, or both at once. Responses are cached for 24 hours, and repeated requests served from cache are not billed again.

Endpoint

GET /api/v1/search

Parameters:

ParameterDescription
articleRequired. The article number to search for.
sourcebase1 = Database 1, base2 = Database 2, all = both. Default: all.
tokenOptional query token when authentication is enabled. Header-based auth is recommended for production.

Authentication

Current mode:

Authentication required

Recommended production header:

Authorization: Bearer YOUR_TOKEN

Alternative header:

X-API-Key: YOUR_TOKEN

cURL Example

curl "https://cross.alexdrozdov.com/api/v1/search?article=6PK1230&source=all"

Production example with authorization enabled:

curl -H "Authorization: Bearer YOUR_TOKEN" ^
  "https://cross.alexdrozdov.com/api/v1/search?article=6PK1230&source=all"

PHP Example

<?php

$url = 'https://cross.alexdrozdov.com/api/v1/search?article=6PK1230&source=all';
$token = 'YOUR_TOKEN';

$ch = curl_init();
curl_setopt_array($ch, [
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Accept: application/json',
        'Authorization: Bearer ' . $token,
    ],
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo "HTTP: " . $httpCode . PHP_EOL;
echo $response;

Response Example

{
  "success": true,
  "meta": {
    "article": "6PK1230",
    "normalized_article": "6PK1230",
    "source": "all",
    "auth_required": false,
    "cache": {
      "hit": false,
      "ttl_hours": 24
    },
    "result_count": 4
  },
  "data": {
    "base1": {
      "DAYCO": [
        { "brand": "DAYCO", "article": "6PK1230" }
      ]
    },
    "base2": {
      "CONTINENTAL": [
        { "brand": "CONTINENTAL", "article": "6PK1230" }
      ]
    }
  }
}

When authentication is enabled, the response also includes token usage information such as the monthly limit and remaining requests.

Errors

HTTPMeaning
400Missing article, unknown source, invalid token, or monthly limit exceeded.
404Route not found.
500Server or database error.