定制 sharpapi/laravel-content-keywords 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sharpapi/laravel-content-keywords

最新稳定版本:v1.0.3

Composer 安装命令:

composer require sharpapi/laravel-content-keywords

包简介

AI Content Keywords Generator for Laravel powered by SharpAPI.com

README 文档

README

Latest Version on Packagist Total Downloads

This package provides a Laravel integration for the SharpAPI Content Keywords Generator. It allows you to generate keywords or tags from any text content, which is perfect for SEO optimization, content categorization, and more.

Installation

You can install the package via composer:

composer require sharpapi/laravel-content-keywords

Configuration

Publish the config file with:

php artisan vendor:publish --tag="sharpapi-content-keywords"

This is the contents of the published config file:

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),
];

Make sure to set your SharpAPI key in your .env file:

SHARP_API_KEY=your-api-key

Usage

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

Parameters

  • text (string): The text content to generate keywords from
  • language (string|null): The language of the content (default: English)
  • maxQuantity (int|null): Maximum number of keywords to generate
  • voiceTone (string|null): The tone of voice for the keywords (e.g., professional, casual)
  • context (string|null): Additional context to improve keyword relevance

Response Format

The response is a JSON string containing an array of keywords:

{
  "data": {
    "type": "api_job_result",
    "id": "b93aae27-87b8-4c68-925a-f6c991cc563c",
    "attributes": {
      "status": "success",
      "type": "content_keywords",
      "result": [
        "Las Vegas Grand Prix",
        "Max Verstappen",
        "Formel 1",
        "Lewis Hamilton",
        "Fernando Alonso"
      ]
    }
  }
}

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-09