On this page
Less setup. More building.
Use the tested catalog examples with your own authorized API key. No credentials are included in these downloads.
Existing kit: 1.0.0 · 3 December 2026. Documentation supplement: 1.1.0 · 4 December 2026.
Download complete API documentation v1.1.0 (Markdown). The original ZIP remains version 1.0.0 and does not include the new PHP example; download it separately below.
Choose your language
bash examples/requests.shFirst 10 Dofollow listings with DR 30 or higher. No automatic retries.
python3 examples/catalog.py --min-dr 30 --pages 2 --per-page 5 --output catalog.csvPython 3.10+, standard library only. Keep TLS verification enabled.
node examples/catalog.mjs --min-dr 30 --pages 2 --per-page 5 --output catalog.csvNode.js 22+, no additional packages.
PHP / Laravel / Guzzle
Use PHP 8.2+ and Guzzle in an existing Laravel application or a standalone PHP project. The PHP example needs Guzzle and its Composer autoloader; the Python and JavaScript examples remain dependency-free. For standalone use, install guzzlehttp/guzzle, save the example beside vendor/ as catalog.php, set POSTICY_API_KEY privately and run php catalog.php. In Laravel, use the existing Composer autoloader rather than the standalone require line.
The example makes one read, keeps TLS verification enabled, refuses redirects and reports bounded retry guidance for 429 without automatically retrying. Validated on 4 December 2026 using PHP 8.5 WASM and Guzzle 7.17: syntax, local error fixtures and a live read of five listings. This isolated runtime is separate from the Posticy server environment. The earlier cURL, Python, JavaScript and Postman results below remain dated 3 December.
Full PHP example
<?php
// PHP 8.2+. Run on your server or locally, with Guzzle already installed.
use GuzzleHttp\Client;
$key = getenv('POSTICY_API_KEY');
if (!$key || strpos($key, 'MKT_') !== 0 || preg_match('/[\r\n]/', $key)) {
fwrite(STDERR, "Set POSTICY_API_KEY privately.\n");
exit(1);
}
require __DIR__ . '/vendor/autoload.php';
$client = new Client([
'base_uri' => 'https://marketplace.posticy.com/api/v1/',
'headers' => ['X-API-Key' => $key, 'Accept' => 'application/json'],
'timeout' => 30,
'connect_timeout' => 10,
'allow_redirects' => false,
'http_errors' => false,
]);
try {
// One small read; no automatic retries or full-catalog crawl.
$response = $client->get('marketplace/websites', [
'query' => ['per_page' => 5, 'page' => 1, 'min_dr' => 30],
]);
$status = $response->getStatusCode();
if ($status !== 200) {
if ($status === 429) {
$error = json_decode((string) $response->getBody(), true);
$wait = is_array($error) ? ($error['retry_after'] ?? null) : null;
if (is_numeric($wait) && is_finite((float) $wait) && $wait >= 0 && $wait <= 86400) {
fwrite(STDERR, 'Rate limited. Wait ' . (int) ceil($wait) . " seconds before retrying.\n");
exit(1);
}
}
throw new RuntimeException('Request failed');
}
$body = json_decode((string) $response->getBody(), true, 512, JSON_THROW_ON_ERROR);
if (!is_array($body) || ($body['success'] ?? false) !== true
|| !is_array($body['data'] ?? null) || !array_is_list($body['data'])) {
throw new RuntimeException('Unexpected response');
}
// Validate the entire page before printing anything, avoiding partial results.
$lines = [];
foreach ($body['data'] as $website) {
if (!is_array($website) || !is_string($website['domain'] ?? null)
|| $website['domain'] === '' || !is_array($website['services'] ?? null)) {
throw new RuntimeException('Unexpected listing');
}
$offers = [];
foreach (['guest_post', 'link_insertion'] as $name) {
$service = $website['services'][$name] ?? null;
if (!is_array($service) || !is_bool($service['available'] ?? null)
|| !array_key_exists('price', $service) || !array_key_exists('currency', $service)) {
throw new RuntimeException('Unexpected service');
}
if ($service['available']) {
if (!is_numeric($service['price']) || !is_finite((float) $service['price'])
|| $service['price'] <= 0 || !in_array($service['currency'], ['EUR', 'USD', 'GBP'], true)) {
throw new RuntimeException('Unexpected service price');
}
$offers[] = $name . ': ' . $service['price'] . ' ' . $service['currency'];
} elseif ($service['price'] !== null || $service['currency'] !== null) {
throw new RuntimeException('Unexpected unavailable service');
}
}
// CLI output only; escape returned text if you render it in HTML.
$lines[] = $website['domain'] . ' | ' . ($website['link_type'] ?? 'Unknown link type')
. ' | ' . implode(', ', $offers);
}
if ($lines) {
echo implode(PHP_EOL, $lines) . PHP_EOL;
}
} catch (Throwable $error) {
// Do not log request headers, keys or raw exception messages.
fwrite(STDERR, "Catalog request failed. Check access, input and connectivity.\n");
exit(1);
}
Postman
Import the collection and local environment from the ZIP. Set your key privately and run List websites before Get website details. Keep credentials out of exported or shared environments.
Validated on the live API
5 requests · 12 assertions
Zero failures across list, filtered list, detail and credential checks.
Matching catalog results
Two pages of five records, 10 unique IDs, matching service prices and successful details.
Validated on 3 December 2026. Production rate-limit exhaustion, credential revocation and a full-catalog crawl were not performed.
Full cURL example
#!/usr/bin/env bash
# Read-only requests. Set POSTICY_API_KEY privately before running. Never use set -x.
set -euo pipefail
: "${POSTICY_API_KEY:?Set POSTICY_API_KEY in your private environment}"
case "$POSTICY_API_KEY" in MKT_*) ;; *) echo 'Expected an MKT_ key' >&2; exit 1 ;; esac
# No redirects: do not forward this header to another host.
curl --silent --show-error --fail-with-body --max-time 30 --get \
'https://marketplace.posticy.com/api/v1/marketplace/websites' \
--header "X-API-Key: ${POSTICY_API_KEY}" \
--header 'Accept: application/json' \
--data-urlencode 'per_page=10' --data-urlencode 'page=1' \
--data-urlencode 'min_dr=30' --data-urlencode 'link_type=Dofollow'
# To filter country IDs, add --data-urlencode 'country_id[]=YOUR_CONFIRMED_ID'.
# This request does not retry automatically. On 429, read retry_after and wait.
Full Python example
#!/usr/bin/env python3
"""Read-only Posticy catalog example. Python 3.10+, standard library only."""
import argparse
import csv
import json
import os
import sys
import tempfile
import time
import urllib.error
import urllib.parse
import urllib.request
from pathlib import Path
BASE = "https://marketplace.posticy.com/api/v1/marketplace/websites"
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self, *args, **kwargs):
return None
def get_json(url, key):
opener = urllib.request.build_opener(NoRedirect())
for attempt in range(4):
request = urllib.request.Request(url, headers={"X-API-Key": key, "Accept": "application/json"})
try:
with opener.open(request, timeout=30) as response:
result = json.load(response)
if not isinstance(result, dict) or result.get("success") is not True:
raise ValueError("API did not return success=true")
return result
except urllib.error.HTTPError as error:
if error.code != 429 or attempt == 3:
raise ValueError(f"API HTTP {error.code}; no export written") from None
try:
delay = float(json.load(error).get("retry_after", 1))
except (ValueError, TypeError, AttributeError):
delay = 1
if not 0 <= delay <= 120:
raise ValueError("Rate limit requires a longer wait; rerun later") from None
time.sleep(delay)
raise ValueError("Retry limit reached")
def collect(base, key, filters, pages, per_page):
rows = {}
truncated = False
for page in range(1, pages + 1):
payload = get_json(base + "?" + urllib.parse.urlencode({**filters, "page": page, "per_page": per_page}, doseq=True), key)
data, pagination = payload.get("data"), payload.get("pagination", {})
if not isinstance(data, list) or not isinstance(pagination, dict):
raise ValueError("Unexpected catalog response shape")
if pagination.get("current_page") != page or not isinstance(pagination.get("has_next_page"), bool):
raise ValueError("Unexpected pagination metadata")
for row in data:
if not isinstance(row, dict) or not row.get("id") or not isinstance(row.get("services"), dict):
raise ValueError("Unexpected website fields")
rows[str(row["id"])] = row
truncated = pagination["has_next_page"]
if not truncated:
break
return list(rows.values()), truncated
FIELDS = ["id", "domain", "listing_url", "country", "language", "category", "dr", "da", "guest_post_available", "guest_post_price", "guest_post_currency", "link_insertion_available", "link_insertion_price", "link_insertion_currency", "link_insertion_price_source"]
def flatten(row):
result = {k: row.get(k) for k in FIELDS[:8]}
result["category"] = "; ".join(row.get("category") or [])
for name in ("guest_post", "link_insertion"):
service = row["services"].get(name, {})
for field in ("available", "price", "currency"):
result[f"{name}_{field}"] = service.get(field)
result["link_insertion_price_source"] = row["services"].get("link_insertion", {}).get("price_source")
return {k: ("'" + v if isinstance(v, str) and v.lstrip().startswith(("=", "+", "-", "@")) else v) for k, v in result.items()}
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--pages", type=int, default=1, help="Maximum pages to request; default 1, never an implicit full crawl")
parser.add_argument("--per-page", type=int, default=10)
parser.add_argument("--min-dr", type=float)
parser.add_argument("--max-price", type=float, help="Raw Guest Post amount, not converted between currencies")
parser.add_argument("--country-id", action="append", type=int, default=[])
parser.add_argument("--id", help="Read one id previously returned by the list")
parser.add_argument("--output", default="posticy-catalog.csv")
parser.add_argument("--test-base", help=argparse.SUPPRESS)
args = parser.parse_args()
if not 1 <= args.pages <= 10000 or not 1 <= args.per_page <= 100:
parser.error("pages must be 1..10000; per-page must be 1..100")
key = os.environ.get("POSTICY_API_KEY", "")
if not key.startswith("MKT_") or any(c in key for c in "\r\n"):
parser.error("Set a valid POSTICY_API_KEY in your private environment")
base = BASE
if args.test_base:
parsed = urllib.parse.urlsplit(args.test_base)
if parsed.scheme != "http" or parsed.hostname != "127.0.0.1" or parsed.username or parsed.password:
parser.error("test-base accepts only http://127.0.0.1")
base = args.test_base
if args.id:
payload = get_json(base + "/" + urllib.parse.quote(args.id, safe=""), key)
print(json.dumps(payload, ensure_ascii=False, indent=2))
return
filters = {}
if args.min_dr is not None:
filters["min_dr"] = args.min_dr
if args.max_price is not None:
filters["max_price"] = args.max_price
if args.country_id:
filters["country_id[]"] = args.country_id
rows, truncated = collect(base, key, filters, args.pages, args.per_page)
target = Path(args.output)
temporary = None
try:
with tempfile.NamedTemporaryFile(mode="w", encoding="utf-8", newline="", dir=target.parent, delete=False) as handle:
temporary = handle.name
writer = csv.DictWriter(handle, fieldnames=FIELDS)
writer.writeheader()
writer.writerows(flatten(row) for row in rows)
os.replace(temporary, target)
finally:
if temporary and os.path.exists(temporary):
os.unlink(temporary)
print(f"Exported {len(rows)} unique websites. {'PARTIAL: page cap reached; not a complete catalog.' if truncated else 'Reached final result page; offset pagination is not a snapshot.'}", file=sys.stderr)
if __name__ == "__main__":
try:
main()
except Exception:
print("Request or export failed. Check access, input, connectivity and rate limits. No credential details logged.", file=sys.stderr)
sys.exit(1)
Full JavaScript example
#!/usr/bin/env node
// Read-only Posticy catalog example. Node.js 22+, no dependencies.
import { writeFile, rename, rm } from 'node:fs/promises';
import { randomUUID } from 'node:crypto';
const BASE = 'https://marketplace.posticy.com/api/v1/marketplace/websites';
if (Number(process.versions.node.split('.')[0]) < 22) {
console.error('This example requires Node.js 22 or newer.');
process.exit(2);
}
const args = {};
for (let i = 2; i < process.argv.length; i += 2) {
if (!process.argv[i].startsWith('--') || process.argv[i + 1] === undefined) throw Error('Expected --option value');
const name = process.argv[i].slice(2);
if (!['pages', 'per-page', 'min-dr', 'max-price', 'country-id', 'id', 'output', 'test-base'].includes(name)) throw Error('Unknown option');
(args[name] ??= []).push(process.argv[i + 1]);
}
const value = (name, fallback) => args[name]?.at(-1) ?? fallback;
async function getJSON(url, key) {
for (let attempt = 0; attempt < 4; attempt++) {
const response = await fetch(url, { headers: { 'X-API-Key': key, Accept: 'application/json' }, redirect: 'error', signal: AbortSignal.timeout(30000) });
if (response.status === 429 && attempt < 3) {
const body = await response.json();
const delay = Number(body.retry_after ?? 1);
if (!Number.isFinite(delay) || delay < 0 || delay > 120) throw Error('Rate limit requires a longer wait; rerun later');
await new Promise(resolve => setTimeout(resolve, delay * 1000));
continue;
}
if (!response.ok) throw Error(`API HTTP ${response.status}`);
const body = await response.json();
if (body.success !== true) throw Error('API did not return success=true');
return body;
}
throw Error('Retry limit reached');
}
const fields = ['id','domain','listing_url','country','language','category','dr','da','guest_post_available','guest_post_price','guest_post_currency','link_insertion_available','link_insertion_price','link_insertion_currency','link_insertion_price_source'];
function flatten(row) {
const result = { ...row, category: (row.category ?? []).join('; ') };
for (const name of ['guest_post', 'link_insertion']) {
for (const field of ['available', 'price', 'currency']) result[`${name}_${field}`] = row.services[name]?.[field];
}
result.link_insertion_price_source = row.services.link_insertion?.price_source;
return result;
}
function csvCell(value) {
let text = value == null ? '' : String(value);
if (typeof value === 'string' && /^[\s]*[=+@-]/.test(text)) text = "'" + text;
return '"' + text.replaceAll('"', '""') + '"';
}
async function main() {
const key = process.env.POSTICY_API_KEY ?? '';
if (!key.startsWith('MKT_') || /[\r\n]/.test(key)) throw Error('Set POSTICY_API_KEY');
let base = BASE;
if (args['test-base']) {
const test = new URL(value('test-base'));
if (test.protocol !== 'http:' || test.hostname !== '127.0.0.1' || test.username || test.password) throw Error('test-base is loopback only');
base = test.href;
}
if (args.id) {
console.log(JSON.stringify(await getJSON(base + '/' + encodeURIComponent(value('id')), key), null, 2));
return;
}
const pages = Number(value('pages', 1)), perPage = Number(value('per-page', 10));
if (!Number.isInteger(pages) || pages < 1 || pages > 10000 || !Number.isInteger(perPage) || perPage < 1 || perPage > 100) throw Error('Invalid page limits');
const rows = new Map();
let truncated = false;
for (let page = 1; page <= pages; page++) {
const url = new URL(base);
url.searchParams.set('page', page); url.searchParams.set('per_page', perPage);
for (const name of ['min-dr', 'max-price']) if (args[name]) url.searchParams.set(name.replace('-', '_'), value(name));
for (const id of args['country-id'] ?? []) url.searchParams.append('country_id[]', id);
const body = await getJSON(url, key);
if (!Array.isArray(body.data) || body.pagination?.current_page !== page || typeof body.pagination?.has_next_page !== 'boolean') throw Error('Unexpected catalog shape');
for (const row of body.data) {
if (!row?.id || !row.services || typeof row.services !== 'object') throw Error('Unexpected website fields');
rows.set(String(row.id), row);
}
truncated = body.pagination.has_next_page;
if (!truncated) break;
}
const csv = [fields.map(csvCell).join(','), ...[...rows.values()].map(flatten).map(row => fields.map(f => csvCell(row[f])).join(','))].join('\r\n') + '\r\n';
const output = value('output', 'posticy-catalog.csv'), temporary = `${output}.${randomUUID()}.tmp`;
try { await writeFile(temporary, csv, { flag: 'wx', mode: 0o600 }); await rename(temporary, output); }
finally { await rm(temporary, { force: true }); }
console.error(`Exported ${rows.size} unique websites. ${truncated ? 'PARTIAL: page cap reached; not a complete catalog.' : 'Reached final result page; offset pagination is not a snapshot.'}`);
}
main().catch(() => { console.error('Request or export failed. Check access, input, connectivity and rate limits. No credential details logged.'); process.exitCode = 1; });
Postman files
Collection in developer kit ZIP ↓ · Blank environment in developer kit ZIP ↓
Set the key only in your private local environment. The examples read process environment variables; .env.example is not loaded automatically.