Live lookup

Test the API with a real request

Choose the lookup type, enter a value, and inspect the endpoint, result table, and raw JSON.

Lookup type

Postcode must contain exactly 5 digits.

Results will appear here after a lookup.

Endpoints

How the two lookups connect

The postcode endpoint starts from a postal code. The place endpoint starts from a Greek place name and returns matches based on the prefix.

Exact postcode lookup GET

Lookup by postcode

Returns all places and streets that match a valid 5-digit Greek postcode.

The {postcode} value must contain exactly 5 digits. Whitespace inside the value is removed before lookup.

See the place lookup endpoint
/api/postcode/{postcode} Open endpoint

Successful response example

{
  "ok": true,
  "type": "postcode",
  "query": "10431",
  "count": 1,
  "results": [
    {
      "postcode": "10431",
      "place": "ΑΘΗΝΑ",
      "streets": [
        {
          "street": "3ης Σεπτεμβρίου",
          "numberRange": "1-3 2-4"
        }
      ]
    }
  ]
}

Error example

{
  "ok": false,
  "type": "postcode",
  "query": "99999",
  "error": "postcode_not_found",
  "message": "Postcode not found."
}
Greek place prefix lookup GET

Lookup by place name

Returns postcodes and streets for places that start with the provided Greek prefix.

The {place} value must not be empty. The lookup normalizes case, spacing, and Greek accents.

See the postcode lookup endpoint
/api/place/{place} Open endpoint

Successful response example

{
  "ok": true,
  "type": "place",
  "query": "ΑΘΗΝΑ",
  "count": 1,
  "results": [
    {
      "place": "ΑΘΗΝΑ",
      "postcode": "10431",
      "streets": [
        {
          "street": "3ης Σεπτεμβρίου",
          "numberRange": "1-3 2-4"
        }
      ]
    }
  ]
}

Error example

{
  "ok": false,
  "type": "place",
  "query": "ΑΝΥΠΑΡΚΤΟ",
  "error": "place_not_found",
  "message": "Place not found."
}

Code examples

Ready examples for cURL, PHP cURL and JavaScript

Use these samples as a base for checkout validation, admin tools, or backend integrations.

Samples for postcode lookup

cURL

curl "https://support.opencartgreece.gr/api/postcode/10431"

PHP cURL

<?php
$url = 'https://support.opencartgreece.gr/api/postcode/10431';

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

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

$data = json_decode($response, true);

if ($httpCode >= 400 || empty($data['ok'])) {
    throw new RuntimeException($data['message'] ?? (string) $httpCode);
}

print_r($data['results']);

JavaScript fetch

const response = await fetch('/api/postcode/10431', {
  headers: { Accept: 'application/json' },
});

const data = await response.json();

if (!response.ok || !data.ok) {
  throw new Error(data.message ?? String(response.status));
}

console.log(data.results);

Samples for place lookup

cURL

curl "https://support.opencartgreece.gr/api/place/%CE%91%CE%98%CE%97%CE%9D%CE%91"

PHP cURL

<?php
$url = 'https://support.opencartgreece.gr/api/place/%CE%91%CE%98%CE%97%CE%9D%CE%91';

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

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

$data = json_decode($response, true);

if ($httpCode >= 400 || empty($data['ok'])) {
    throw new RuntimeException($data['message'] ?? (string) $httpCode);
}

print_r($data['results']);

JavaScript fetch

const response = await fetch('/api/place/%CE%91%CE%98%CE%97%CE%9D%CE%91', {
  headers: { Accept: 'application/json' },
});

const data = await response.json();

if (!response.ok || !data.ok) {
  throw new Error(data.message ?? String(response.status));
}

console.log(data.results);

FAQ

What to know before using it

Short answers about access, validation, response shape, and available errors.

When should I use this API?

Use it when you need quick postcode lookup for checkout validation, courier workflows, admin tools, or backend integrations.

What does /api/postcode/{postcode} accept?

It accepts a Greek postcode with exactly 5 digits. If the value is invalid, the API returns a JSON error with ok: false.

How does /api/place/{place} work?

The lookup runs as a prefix search against Greek place names. The API normalizes case, extra spacing, and accents.

What is the response format?

Successful responses include ok, type, query, count and results. Each result includes place, postcode and a streets list with street and numberRange.

What happens when there is no match?

The API returns a JSON error with ok: false, type, query, error and message. Unknown postcodes or places return 404.

Need a custom postcode or courier workflow?

We can adapt validation, checkout flows, or courier integrations for your OpenCart store.

Talk to us