A PHP library for fetching supplier data from the ThomasNet Suppliers Database using the Apify ThomasNet Supplier Scraper. Returns fully typed DTOs for easy integration into your application. Safe, reliable and scalable.
composer require scraper-apis/thomasnet-scraper- PHP 8.3+
- Apify API token (get one here)
use ThomasNetScraper\Client;
use ThomasNetScraper\SearchMode;
$client = new Client('YOUR_APIFY_TOKEN');
// Search for valve manufacturers
$suppliers = $client->search('valve manufacturer');
foreach ($suppliers as $supplier) {
echo $supplier->name . ' - ' . $supplier->primaryPhone . PHP_EOL;
}$suppliers = $client->search('CNC machining', SearchMode::All);$suppliers = $client->search('Siemens', SearchMode::Name, maxResults: 50);use ThomasNetScraper\Area;
$suppliers = $client->search(
query: 'precision machining',
mode: SearchMode::All,
area: Area::Michigan,
maxResults: 500
);foreach ($suppliers as $supplier) {
// Company info
echo $supplier->name;
echo $supplier->description;
echo $supplier->yearFounded;
echo $supplier->annualSales; // e.g., "$250 Mil. and over"
echo $supplier->numberEmployees; // e.g., "1000+"
// Contact
echo $supplier->primaryPhone;
echo $supplier->website;
// Location
echo $supplier->address->city;
echo $supplier->address->state;
echo $supplier->address->latitude;
echo $supplier->address->longitude;
// Certifications
foreach ($supplier->certifications as $cert) {
echo $cert->title; // e.g., "ISO 9001:2015"
echo $cert->type; // e.g., "QUALITY"
echo $cert->scope;
}
// Products
foreach ($supplier->products as $product) {
echo $product->name;
echo $product->description;
}
// Personnel
foreach ($supplier->personnel as $person) {
echo $person->name;
echo $person->title;
}
}// Filter for ISO 9001 certified suppliers
$iso9001Suppliers = array_filter(
$suppliers,
fn ($s) => $s->hasCertification('ISO 9001')
);
// Filter by state
$texasSuppliers = array_filter(
$suppliers,
fn ($s) => $s->address->state === 'TX'
);
// Filter by employee count
$largeSuppliers = array_filter(
$suppliers,
fn ($s) => $s->numberEmployees === '1000+'
);| Property | Type | Description |
|---|---|---|
tgramsId |
string | Unique identifier |
name |
string | Company name |
description |
?string | Company description |
type |
?string | Supplier type |
tier |
?string | ThomasNet tier |
yearFounded |
?int | Year established |
annualSales |
?string | Revenue range |
numberEmployees |
?string | Employee count range |
primaryPhone |
?string | Main phone number |
website |
?string | Company website |
logoUrl |
?string | Logo image URL |
address |
Address | Location details |
certifications |
Certification[] | Quality certifications |
products |
Product[] | Product catalog |
headings |
Heading[] | ThomasNet category headings |
personnel |
Person[] | Company contacts |
brands |
Brand[] | Brand names |
social |
SocialLink[] | Social media links |
videos |
Video[] | Company videos |
news |
NewsArticle[] | Press releases |
whitepapers |
Whitepaper[] | Technical documents |
isMultiLocation |
bool | Has multiple locations |
xometryVerified |
bool | Xometry verification status |
isClaimed |
bool | Profile claimed by company |
scrapedAt |
DateTimeImmutable | Data extraction timestamp |
| Property | Type |
|---|---|
address1 |
?string |
address2 |
?string |
city |
?string |
state |
?string |
stateName |
?string |
zip |
?string |
country |
?string |
latitude |
?float |
longitude |
?float |
| Property | Type |
|---|---|
id |
int |
code |
string |
title |
string |
type |
string |
group |
?string |
scope |
?string |
imageUrl |
?string |
url |
?string |
date |
?string |
| Code | Region |
|---|---|
NA |
All (North America) |
NT |
Texas North |
GT |
Texas South |
CN |
California North |
CS |
California South |
DN |
New York Metro |
UN |
New York Upstate |
IL |
Illinois |
MI |
Michigan |
NO |
Ohio North |
SO |
Ohio South |
EP |
Pennsylvania East |
WP |
Pennsylvania West |
ON |
Ontario |
QC |
Quebec |
See Area enum for the complete list of 50+ regions.
use ThomasNetScraper\Exception\ApiException;
use ThomasNetScraper\Exception\RateLimitException;
use ThomasNetScraper\Exception\InvalidQueryException;
try {
$suppliers = $client->search('valve');
} catch (RateLimitException $e) {
// Handle rate limiting
sleep($e->retryAfter);
} catch (ApiException $e) {
// Handle API errors
echo $e->getMessage();
}When running multiple queries, use tgramsId as the unique key:
$allSuppliers = [];
foreach (['valve', 'pump', 'fitting'] as $query) {
foreach ($client->search($query) as $supplier) {
$allSuppliers[$supplier->tgramsId] = $supplier;
}
}
// $allSuppliers now contains unique suppliers onlyMIT