Automate workflows in E-Commerce, Marketing, Content Management, HR Tech, and Travel with AI-powered API. Connects to PHP applications for content analysis and automation.
git clone https://github.com/sharpapi/sharpapi-php-client.gitSharpAPI PHP Client is a deprecated monolithic SDK that has been replaced by specialized, endpoint-specific packages. The original package provided AI-powered automation for content management, e-commerce product analysis, HR workflows, and travel industry applications through PHP integrations. Users currently relying on this package can continue using it, but SharpAPI recommends migrating to focused packages like php-content-summarize-text, php-ecommerce-product-review-sentiment, and php-hr-job-description-generator for better performance, reduced dependencies, and clearer documentation. The specialized packages offer improved type safety, smaller footprints, and independent versioning per endpoint.
[{"step":"Install the sharpapi-php-client library via Composer.","action":"Run `composer require sharpapi/sharpapi-php-client` in your PHP project directory. Ensure your PHP version is 7.4 or higher.","tip":"Check the library's GitHub repository for the latest version and installation instructions."},{"step":"Initialize the client with your API key.","action":"Create a new instance of SharpAPIClient and pass your API key as a parameter. Store this key securely using environment variables.","tip":"Never hardcode your API key in the source code. Use a .env file and load it with a package like vlucas/phpdotenv."},{"step":"Select the appropriate API endpoint for your task.","action":"Choose from endpoints like /content/analyze, /content/generate, or /campaigns/automate based on your marketing workflow. Refer to the SharpAPI documentation for endpoint details.","tip":"Use the /content/analyze endpoint for sentiment analysis, /content/generate for content creation, and /campaigns/automate for email or ad campaign automation."},{"step":"Pass your data and parameters to the endpoint.","action":"Structure your request with the required parameters (e.g., product_id, texts, options) and any additional filters. Validate your input data before sending.","tip":"Use PHP's array_filter function to remove empty or invalid parameters before sending the request."},{"step":"Process and act on the API response.","action":"Parse the JSON response and implement conditional logic to trigger follow-up actions (e.g., sending emails, updating CRM). Log errors for debugging.","tip":"Use PHP's json_decode with the associative array flag for easier data manipulation. Implement try-catch blocks to handle API errors gracefully."}]
Migrating legacy PHP applications from monolithic SDK to specialized endpoint packages
Existing projects maintaining current implementations while planning upgrades
Evaluating replacement packages for content summarization, translation, and grammar checking
Assessing specialized solutions for e-commerce product categorization and review sentiment analysis
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/sharpapi/sharpapi-php-clientCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Use the sharpapi-php-client to [ACTION] for [TARGET_APPLICATION] in [MARKETING_DOMAIN]. Specifically, [SPECIFIC_TASK] using the [API_ENDPOINT] endpoint. Include [ADDITIONAL_PARAMETERS] if needed. Example: 'Use the sharpapi-php-client to analyze sentiment for customer reviews in an e-commerce store. Specifically, extract key themes and sentiment scores from recent product reviews using the /content/analyze endpoint. Include the product_id parameter for filtering.'
```php
<?php
require 'vendor/autoload.php';
use SharpAPI\Client\SharpAPIClient;
// Initialize the client with your API key
$client = new SharpAPIClient('your_api_key_here');
// Analyze customer reviews for sentiment and themes
$response = $client->content()->analyze([
'product_id' => 'prod_12345',
'texts' => [
'This product exceeded my expectations! The quality is amazing.',
'The delivery was late, but the product itself is okay.',
'Terrible customer service. Would not recommend.'
],
'options' => [
'include_themes' => true,
'include_sentiment' => true
]
]);
// Process the response
$sentimentScores = $response['sentiment_scores'];
$themes = $response['themes'];
// Output results
foreach ($sentimentScores as $index => $score) {
echo "Review " . ($index + 1) . ":\n";
echo " Sentiment: " . $score . " (" . ($score > 0 ? 'Positive' : ($score < 0 ? 'Negative' : 'Neutral')) . ")\n";
echo " Themes: " . implode(', ', $themes[$index]) . "\n\n";
}
// Generate follow-up actions based on analysis
if ($sentimentScores[0] > 0.5) {
echo "Action: Send a thank-you email to customer for review " . ($index + 1) . " with a discount code.\n";
} elseif ($sentimentScores[2] < -0.5) {
echo "Action: Escalate review " . ($index + 2) . " to customer service team for follow-up.\n";
}
```
**Analysis Results:**
- **Review 1:** Sentiment score of 0.8 (Positive). Themes: Quality, Expectations.
- **Review 2:** Sentiment score of -0.2 (Neutral). Themes: Delivery, Product Quality.
- **Review 3:** Sentiment score of -0.9 (Negative). Themes: Customer Service, Recommendation.
**Recommended Actions:**
1. Send a personalized thank-you email to the first reviewer with a 15% discount code for their next purchase.
2. Follow up with the third reviewer to address their customer service concerns and offer a refund or replacement.
3. Monitor delivery times for product_12345 to prevent future negative reviews related to shipping delays.Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan