PHP code example of sharpapi / laravel-content-keywords

1. Go to this page and download the library: Download sharpapi/laravel-content-keywords 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/ */

    

sharpapi / laravel-content-keywords example snippets


return [
    'api_key' => env('SHARP_API_KEY'),
    'base_url' => env('SHARP_API_BASE_URL', 'https://sharpapi.com/api/v1'),
    'api_job_status_polling_wait' => env('SHARP_API_JOB_STATUS_POLLING_WAIT', 180),
    'api_job_status_polling_interval' => env('SHARP_API_JOB_STATUS_POLLING_INTERVAL', 10),
    'api_job_status_use_polling_interval' => env('SHARP_API_JOB_STATUS_USE_POLLING_INTERVAL', false),
];

use SharpAPI\ContentKeywords\ContentKeywordsService;

$service = new ContentKeywordsService();

// Generate keywords from text
$keywords = $service->generateKeywords(
    'Your text content here',
    'English', // optional language
    10, // optional max quantity
    'professional', // optional voice tone
    'technology blog' // optional context
);

// $keywords will contain a JSON string with the generated keywords
bash
php artisan vendor:publish --tag="sharpapi-content-keywords"