curl --request GET \
--url https://www.closient.com/resolver/api/v1/public/gs1/compressimport requests
url = "https://www.closient.com/resolver/api/v1/public/gs1/compress"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://www.closient.com/resolver/api/v1/public/gs1/compress', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.closient.com/resolver/api/v1/public/gs1/compress",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.closient.com/resolver/api/v1/public/gs1/compress"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.closient.com/resolver/api/v1/public/gs1/compress")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.closient.com/resolver/api/v1/public/gs1/compress")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"ai_map": {
"01": "09506000164908"
},
"compressed_path": "/ARFKk4awWA",
"compressed_segment": "ARFKk4awWA",
"is_valid": true
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}Compress Application Identifiers into a GS1 Digital Link path segment
Bit-pack a primary key plus optional qualifiers/attributes into the single opaque base64url path segment defined by GS1’s Digital Link compression scheme — the exact inverse of /decompress.
Takes the same primary_ai / primary_value / repeated qualifier=code:value / attribute=code:value shape as /build, so the same query string composes both the uncompressed and compressed forms of an identifier set.
An AI set that cannot be compressed (unknown AI code, malformed value, no primary identifier) is a 200 with is_valid: false and the reason — the same triage contract as /validate and /decompress.
Keyless — no API key, no signup. IP-throttled at 300 requests/minute and cached at the edge for 24h, so repeat calls for the same input do not reach origin. Over-rate callers get a 429 with a Retry-After header and a retry_after field — it never silently degrades or returns a wrong answer under load.
curl --request GET \
--url https://www.closient.com/resolver/api/v1/public/gs1/compressimport requests
url = "https://www.closient.com/resolver/api/v1/public/gs1/compress"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://www.closient.com/resolver/api/v1/public/gs1/compress', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.closient.com/resolver/api/v1/public/gs1/compress",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.closient.com/resolver/api/v1/public/gs1/compress"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.closient.com/resolver/api/v1/public/gs1/compress")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.closient.com/resolver/api/v1/public/gs1/compress")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"ai_map": {
"01": "09506000164908"
},
"compressed_path": "/ARFKk4awWA",
"compressed_segment": "ARFKk4awWA",
"is_valid": true
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}Query Parameters
The primary identifier AI code, e.g. 01 for GTIN.
2 - 4The primary identifier's value, e.g. 09506000164908.
1 - 256Repeatable qualifier AI in code:value form, e.g. 10:LOT1.
Repeatable data-attribute AI in code:value form, e.g. 17:261231.
Response
OK
A GS1-compressed Digital Link path segment plus how it graded.
The {ai_code: value} map that was compressed, echoed back for confirmation.
Show child attributes
Show child attributes
True when the AI map compressed successfully.
Why compression failed, or null on success.
The opaque base64url path segment, or null when compression failed.
"ARFKk4awWA"
The GS1-canonical root-relative compressed path (/<compressed_segment>), as served at id.gs1.org, or null when compression failed. Closient's own resolver serves compressed Digital Links under a /c/<segment> prefix instead — see docs.closient.com for why.
"/ARFKk4awWA"