PHPackages                             sharpapi/sharpapi-laravel-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sharpapi/sharpapi-laravel-client

AbandonedLibrary[API Development](/categories/api)

sharpapi/sharpapi-laravel-client
================================

SharpAPI.com - AI-Powered Swiss Army Knife API. Save countless coding hours and supercharge your app with AI capabilities in just 2 lines of code.

v1.3.0(5mo ago)405.9k↓88.9%6MITPHPPHP ^8.1

Since Dec 10Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/sharpapi/sharpapi-laravel-client)[ Packagist](https://packagist.org/packages/sharpapi/sharpapi-laravel-client)[ Docs](https://github.com/sharpapi/sharpapi-laravel-client)[ RSS](/packages/sharpapi-sharpapi-laravel-client/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (8)Dependencies (7)Versions (10)Used By (0)

[![SharpAPI GitHub cover](https://camo.githubusercontent.com/82bb36706c1e71276b3dca4ec9120353bb51c8f22bb62543bf056db5c28da36d/68747470733a2f2f73686172706170692e636f6d2f73686172706170692d6769746875622d6c61726176656c2d62672e6a7067 "SharpAPI Laravel Client")](https://camo.githubusercontent.com/82bb36706c1e71276b3dca4ec9120353bb51c8f22bb62543bf056db5c28da36d/68747470733a2f2f73686172706170692e636f6d2f73686172706170692d6769746875622d6c61726176656c2d62672e6a7067)

⚠️ DEPRECATED - SharpAPI Laravel Client SDK
===========================================

[](#️-deprecated---sharpapi-laravel-client-sdk)

> **IMPORTANT**: This package has been deprecated and is no longer maintained. It has been replaced by smaller, more specialized packages that contain improvements compared to this legacy package. Please use the packages listed below for new integrations.

Replacement Packages
--------------------

[](#replacement-packages)

The following packages replace this deprecated package with improved functionality:

---

### 🛒 E-commerce

[](#-e-commerce)

PackageDescriptionlaravel-ecommerce-product-intro[AI Product Introduction Generator for Laravel](https://github.com/sharpapi/laravel-ecommerce-product-intro)laravel-ecommerce-review-sentiment[AI E-commerce Review Sentiment Analysis for Laravel](https://github.com/sharpapi/laravel-ecommerce-review-sentiment)laravel-ecommerce-product-categories[AI E-commerce Product Categorization for Laravel](https://github.com/sharpapi/laravel-ecommerce-product-categories)laravel-ecommerce-thank-you-email[AI Thank You Email Generator for Laravel](https://github.com/sharpapi/laravel-ecommerce-thank-you-email)---

### 🧠 Content &amp; Marketing Automation

[](#-content--marketing-automation)

PackageDescriptionlaravel-content-proofread[AI Proofreading &amp; Grammar Checker for Laravel](https://github.com/sharpapi/laravel-content-proofread)laravel-content-detect-spam[AI Spam Detection for Laravel](https://github.com/sharpapi/laravel-content-detect-spam)laravel-content-summarize[AI Text Summarization for Laravel](https://github.com/sharpapi/laravel-content-summarize)laravel-content-paraphrase[AI Text Paraphrasing for Laravel](https://github.com/sharpapi/laravel-content-paraphrase)laravel-content-translate[AI Text Translation for Laravel](https://github.com/sharpapi/laravel-content-translate)laravel-content-detect-urls[AI URL Detection for Laravel](https://github.com/sharpapi/laravel-content-detect-urls)laravel-content-keywords[AI Keywords Generator for Laravel](https://github.com/sharpapi/laravel-content-keywords)laravel-content-detect-phones[AI Phone Number Detection for Laravel](https://github.com/sharpapi/laravel-content-detect-phones)laravel-content-detect-emails[AI Email Detection for Laravel](https://github.com/sharpapi/laravel-content-detect-emails)---

### 👷 HR Tech

[](#-hr-tech)

PackageDescriptionlaravel-hr-related-skills[AI Related Skills Generator for Laravel](https://github.com/sharpapi/laravel-hr-related-skills)laravel-resume-parser[AI Resume Parser for Laravel](https://github.com/sharpapi/laravel-resume-parser)laravel-resume-job-match-score[AI Resume-Job Match Scoring for Laravel](https://github.com/sharpapi/laravel-resume-job-match-score)laravel-hr-job-description[AI Job Description Generator for Laravel](https://github.com/sharpapi/laravel-hr-job-description)laravel-hr-related-job-positions[AI Related Job Positions Generator for Laravel](https://github.com/sharpapi/laravel-hr-related-job-positions)---

### ✈️ Travel, Tourism &amp; Hospitality

[](#️-travel-tourism--hospitality)

PackageDescriptionlaravel-tth-hospitality-product-categories[AI Hospitality Product Categorization for Laravel](https://github.com/sharpapi/laravel-tth-hospitality-product-categories)laravel-tth-ta-product-categories[AI Tours &amp; Activities Product Categorization for Laravel](https://github.com/sharpapi/laravel-tth-ta-product-categories)laravel-tth-review-sentiment[AI Travel Review Sentiment Analysis for Laravel](https://github.com/sharpapi/laravel-tth-review-sentiment)---

### 🔍 SEO

[](#-seo)

PackageDescriptionlaravel-seo-generate-tags[AI SEO Tags Generator for Laravel](https://github.com/sharpapi/laravel-seo-generate-tags)---

### 🧰 Utility APIs

[](#-utility-apis)

PackageDescriptionlaravel-airports-database-flight-duration-calculator[Airports Database &amp; Flight Duration Calculator for Laravel](https://github.com/sharpapi/laravel-airports-database-flight-duration-calculator)laravel-job-positions-api[Job Positions Database API for Laravel](https://github.com/sharpapi/laravel-job-positions-api)laravel-skills-database-api[Skills Database API for Laravel](https://github.com/sharpapi/laravel-skills-database-api)laravel-web-scraping-api[Web Scraping API for Laravel](https://github.com/sharpapi/laravel-web-scraping-api)---

Leverage AI API to streamline workflows in E-Commerce, Marketing, Content Management, HR Tech, Travel, and more.
----------------------------------------------------------------------------------------------------------------

[](#leverage-ai-api-to-streamline-workflows-in-e-commerce-marketing-content-management-hr-tech-travel-and-more)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3b78a12874096c55de36cf1fe77a1c2ac3e2bb3606ce7abed62a30b13ef45549/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73686172706170692f73686172706170692d6c61726176656c2d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sharpapi/sharpapi-laravel-client)[![Total Downloads](https://camo.githubusercontent.com/4552aa44a18a6ec6ee94d5c5c123d331149ffcab32489bb4193f82f732aff71f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73686172706170692f73686172706170692d6c61726176656c2d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sharpapi/sharpapi-laravel-client)

See more at [SharpAPI.com Website »](https://sharpapi.com/)

---

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- Laravel &gt;= 9.0

If you don't use Laravel then you can find [Generic SharpAPI PHP Client here »](https://github.com/sharpapi/sharpapi-php-client)

---

Installation
------------

[](#installation)

Follow these steps to install and set up the SharpAPI Laravel Client package.

1. Install the package via `composer`:

```
composer require sharpapi/sharpapi-laravel-client
```

2. Register at [SharpAPI.com](https://sharpapi.com/) and get the API key.
3. Set the API key inside `.env`

```
SHARP_API_KEY=key
```

4. **\[OPTIONAL\]** Publish the configuration file `sharpapi-client.php`.

> **Note:** You no longer need to publish the configuration file to use this package. By default, the package will use sensible default values. You only need to publish the configuration if you wish to customize it.

```
php artisan vendor:publish --tag=sharpapi-laravel-client
```

---

⛲ What can it do for you?
-------------------------

[](#-what-can-it-do-for-you)

- 🛒 **E-commerce**
    - Quickly generate engaging product introductions to attract customers.
    - Automatically create personalized thank-you emails for enhanced customer experience.
    - Streamline product categorization for a well-organized catalog.
    - Sentiment Analysis: Understand and analyze sentiment in product reviews for data-driven decision-making.
- 📝️ **Content &amp; Marketing Automation**
    - Easily translate text for a global audience.
    - Paraphrase and proofread any text (including grammar check)
    - Spam Content Detection: Identify and filter out spam content effectively.
    - Contact Information Extraction: Extract phone numbers and email addresses from non-standard formats for streamlined communication.
    - Generate concise summaries and unique keywords/tags for improved content consumption.
    - Boost SEO efforts by automatically generating META tags based on content.
- ‍💻 **HR Tech**
    - Generate complex job descriptions effortlessly, saving time in the hiring process.
    - Skills and Position Insights: Identify related job positions and skills to streamline recruitment.
    - Automated Resume Parsing: Efficiently parse and extract information from resumes files for easy processing.
- ✈️ **Travel, Tourism &amp; Hospitality**
    - Analyze sentiment in travel reviews to improve services.
    - Streamline categorization for tours, activities, and hospitality products.

---

Features
--------

[](#features)

Please refer to the official:

- [API Documentation](https://sharpapi.com/documentation)
- **Multi-language Support**: Supporting 80 languages for every content or data analysis API endpoint. [Check the list here](https://botpress.com/blog/list-of-languages-supported-by-chatgpt).
- **Easy-to-Use RESTful Format**: With standardized set of endpoints - gain valuable insights through analysis endpoints, covering product categories, skills, and job positions, providing relevant scores.
- **Always the same, clean data formats**: Rest assured with consistent, predictable JSON format for all returned data. No need to worry about fuzzy AI data.
- **Tech Support**: Crafted by developers for developers, we provide continuous assistance throughout your journey.

---

Usage
-----

[](#usage)

You can inject `SharpApiService` class or use the facade `\SharpApiService` singleton.

We recommend you to use Laravel queuing system to optimize dispatched jobs and the process of checking the results, especially if you process bigger batches of data.

Typical use case require these steps:

1. Dispatch one of the available AI processing methods (this will return job processing status URL)
2. Run `fetchResults($statusUrl)` method which operates in polling mode, sending underneath requests every 10 seconds for 180 seconds (these values [can be customized](#optional-custom-configuration)).
3. `SharpApiJob` object will be returned.
4. For a job finished with `success` return status you can obtain the results with one of the methods, for example `$jobResultJson = $jobResult->getResultJson()`.

**Each dispatched job usually takes somewhere between a couple of seconds to a minute.**

After that period a returned job will usually have `success` status and it's results will be available for further processing. Each API method returns different return format. [Go to List of API methods/endpoints below for details»](#list-of-api-methodsendpoints)

Our API guarantees to return correct format every time. AI engines that SharpAPI use in rare cases have a tendency to misbehave and timeout or return incorrect data. In those cases the returned `status` for the job will be `failed`. You can rerun the exact same job request in that case.

As long as the job is still being processed by our engine it will keep returning `pending` status.

### Controller usage example

[](#controller-usage-example)

```
