1. Go to this page and download the library: Download polyzon/polyzon-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
polyzon / polyzon-php example snippets
nt = new Polyzon\Client(); // reads POLYZON_API_KEY
$page = $client->search('дракон', size: 10, free: true);
foreach ($page->items as $item) {
echo "[{$item->source}] {$item->title} — {$item->url}\n";
}
$client = new Polyzon\Client(apiKey: $token);
use Polyzon\Lang;
use Polyzon\License;
use Polyzon\Sort;
use Polyzon\Source;
$page = $client->search(
'органайзер для инструментов', // ant | popular | newest | likes | makes | downloads
free: true, // only free models
sources: [Source::PRINTABLES, Source::THINGIVERSE],
formats: ['stl', '3mf'],
licenses: [License::CC0, License::CC_BY],
lang: Lang::EN, // ru (default) | en — machine-translated titles and tags
);
$page->total; // 1873
$page->totalRelation; // 'eq' (exact) or 'gte' (lower bound)
$page->hasMore; // is there a next page within the 2400-result window
$page->partial; // part of the catalog did not answer
$page->correctedQuery; // the typo-fixed query the server searched for, or null
$page->items[0]; // SearchItem: source, id, title, url, thumbnail, creator, license, price, formats, tags, stats, publishedAt
$model = $client->getModel('thingiverse', 'tv-1234567', lang: Lang::EN);
$model->description;
$model->images; // URLs on the source's CDN
$model->license; // ModelLicense { id: 'cc-by-nc', raw: 'Creative Commons - Attribution - Non-Commercial' } or null
$model->copies; // the same model on other sites: list of ModelRef { source, id }