1. Go to this page and download the library: Download toolcenter/sdk 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/ */
toolcenter / sdk example snippets
oolCenter\ToolCenter;
// Initialize the client with your API key
$tc = new ToolCenter('your-api-key-here');
// Capture a screenshot
$screenshot = $tc->screenshot([
'url' => 'https://example.com',
'width' => 1920,
'height' => 1080,
'format' => 'png'
]);
echo "Screenshot URL: " . $screenshot['url'] . "\n";
$tc = new ToolCenter('your-api-key-here');
// Or with a custom base URL
$tc = new ToolCenter('your-api-key-here', 'https://custom.toolcenter.dev');
// Extract website metadata
$result = $tc->metadata([
'url' => 'https://example.com'
]);
// Include images and social media data
$result = $tc->metadata([
'url' => 'https://example.com',
'
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use ToolCenter\ToolCenter;
class ToolCenterServiceProvider extends ServiceProvider
{
public function register()
{
$this->app->singleton(ToolCenter::class, function ($app) {
return new ToolCenter(config('services.toolcenter.api_key'));
});
}
}