Skip to the content.

SharpAPI GitHub cover

SharpAPI.com - Automate Workflows with AI-powered API

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

Connect with Us

Overview

SharpAPI is a powerful API designed to automate workflows across multiple industries with AI-powered endpoints, allowing you to streamline operations in e-commerce, marketing, content management, HR, and more. Our API uses top AI technologies, including OpenAI’s models and Claude 2, integrated with SharpAPI’s unique capabilities to provide tailored solutions for a variety of applications.

Here’s a section listing the available functionalities of the API, with links to each API Product’s documentation, based on the available sitemap and Postman collection:


SharpAPI Functionalities

SharpAPI offers a wide range of AI-powered products for various business needs. Each product consists of a pair of endpoints: a POST endpoint to initiate the job request and a GET endpoint to retrieve the job results. Here’s a list of all available functionalities, with links to their respective documentation:

E-commerce

Content Marketing Automation

HR Tech

SEO

Travel & Hospitality

Utility

Each API product is designed to perform specialized tasks, and you can review the individual product documentation for detailed usage, parameter requirements, and best practices for each endpoint.


SDK Client Libraries

For streamlined integration, use one of our SDK clients available for multiple programming languages:

Refer to the respective GitHub repositories for setup and usage instructions.

Key Features

1. AI-powered Endpoints

SharpAPI provides endpoints for various tasks such as content generation, paraphrasing, product categorization, and more. Each endpoint is designed with simplicity and efficiency in mind, delivering high-quality results through a standardized RESTful format.

2. Utility Endpoints

Non-AI endpoints offer simple, reliable, and cost-effective options for performing essential tasks. These endpoints can quickly process data and return immediate results, ideal for non-AI based needs.

General Usage

To use the SharpAPI, you need to:

  1. Authenticate: Use Bearer Authentication with your API key.
    Authorization: Bearer YOUR_API_KEY
    
  2. Content Type: All requests should have the Accept: application/json header.
  3. Handling Jobs:
    • Initiate jobs via POST requests to respective endpoints.
    • Poll for status updates on jobs through Retry-After headers and job-specific status URLs.

Best Practices

Non-standard HTTP Headers

SharpAPI uses several custom HTTP headers to enhance API interaction:

Error Handling

SharpAPI handles errors gracefully with detailed responses:

Use Cases

  1. E-commerce Product Descriptions: Generate tailored and engaging product intros with SharpAPI’s e-commerce endpoint.
  2. Content Rewriting for SEO: Improve content quality for search optimization.
  3. HR Applicant Tracking: Categorize resumes or generate job descriptions.
  4. Travel Content Generation: Create compelling travel descriptions for tourism platforms.

  5. Here’s a dedicated section for the 2-Step Approach to using AI-powered API workflows on SharpAPI, explaining the process of dispatching an AI job and retrieving results.

2-Step Approach to Using AI-powered API Workflows

SharpAPI’s AI-powered endpoints follow a straightforward 2-step process that ensures effective task management and optimal performance for content generation, data processing, and more. Here’s how it works:

Step 1: Dispatching the AI Job

The first step is to submit a job request to the relevant AI endpoint. This is done via a POST request, where you provide the required parameters in the request body. After submitting the request, SharpAPI will initiate the processing job and respond with a job_id and a status_url in the response, allowing you to track the progress of the job.

Example: Dispatching a Content Paraphrase Job

POST /api/v1/content/paraphrase
Authorization: Bearer YOUR_API_KEY
Accept: application/json
Content-Type: application/json

Request Body:

{
    "content": "Exploring the vibrant tech industry, we discover amazing advancements.",
    "voice_tone": "enthusiastic",
    "language": "English"
}

Example Response:

{
    "status_url": "https://sharpapi.com/api/v1/content/paraphrase/job/status/5de4887a-0dfd-49b6-8edb-9280e468c210",
    "job_id": "5de4887a-0dfd-49b6-8edb-9280e468c210"
}

The response will contain:

This job_id is also included in the SharpAPI-Job-Id header for easier tracking. Additionally, the Retry-After header specifies how long to wait before polling for results.

Step 2: Checking Job Status & Retrieving Results

Once the job has been dispatched, you can track its progress using the status_url obtained from Step 1. This is done via a GET request. The status will be updated as the job processes, eventually indicating a success or failed outcome. If successful, the response will include the processed results.

Polling Example: Checking Job Status

GET https://sharpapi.com/api/v1/content/paraphrase/job/status/5de4887a-0dfd-49b6-8edb-9280e468c210
Authorization: Bearer YOUR_API_KEY
Accept: application/json

Response for Pending Job:

{
    "data": {
        "type": "api_job",
        "id": "5de4887a-0dfd-49b6-8edb-9280e468c210",
        "attributes": {
            "status": "pending",
            "type": "content_paraphrase"
        }
    }
}

Response for Completed Job:

{
    "data": {
        "type": "api_job_result",
        "id": "5de4887a-0dfd-49b6-8edb-9280e468c210",
        "attributes": {
            "status": "success",
            "type": "content_paraphrase",
            "result": {
                "paraphrase": "As we delve into the dynamic tech sector, we witness remarkable progress."
            }
        }
    }
}

In this final response:

Best Practices for Using the 2-Step Approach

  1. Optimize Polling Intervals: Use the Retry-After header to avoid excessive polling and manage API rate limits effectively.
  2. Error Handling: Implement error handling based on the status field to ensure smooth reattempts for failed jobs.
  3. Tracking with SharpAPI-Job-Id: Use the SharpAPI-Job-Id header for improved job tracking, especially if you’re managing multiple concurrent jobs.
  4. Cost Awareness: Monitor SharpAPI-Cost headers in the responses to track API usage costs for budgeting and optimization.

This 2-step process is designed to handle AI-powered tasks efficiently, ensuring timely and reliable results for applications ranging from content creation to advanced data processing. By integrating this workflow, you can streamline various tasks and enhance the overall functionality of your applications using SharpAPI’s robust AI capabilities.


Note on Job Failures

Occasionally, an AI job may fail to complete successfully. Failures can occur due to several reasons, such as temporary service interruptions, input validation issues, or AI model limitations. When a job fails, the status field in the response will be set to failed, and specific error details will be provided to assist with troubleshooting.

Common Reasons for Job Failure:

Rest assured, no charges are incurred for failed jobs, and you can simply retry the request after addressing the issue. For optimized handling, consider implementing error-checking and retry logic to ensure a smooth user experience.


Utility Endpoints: PING and QUOTA

SharpAPI includes simple utility endpoints like PING and QUOTA to help you manage and monitor your API usage efficiently. These endpoints provide valuable information for ensuring your application’s smooth operation and staying informed about API limits and usage.

PING Endpoint

The PING endpoint is a lightweight endpoint used to check the availability and responsiveness of the SharpAPI service. This is particularly useful for health checks in your application, allowing you to verify the API is up and running before making further requests.

If you receive a successful response, it means the API is functional, and you can proceed with other requests confidently. If the ping check fails, it could indicate temporary downtime or network issues.

QUOTA Endpoint

The QUOTA endpoint provides a summary of your current API usage limits and the remaining resources within your selected pricing plan. By calling this endpoint, you can monitor your usage in real-time, helping you stay within your allocated credits and avoid unexpected service interruptions.

In this example:

402 Payment Required Error

When calling various SharpAPI endpoints, including the AI-powered endpoints, you may encounter a 402 Payment Required HTTP response. This response indicates that you have exhausted the available quota on your current subscription, and further processing requires additional credits or an upgrade in your subscription.

Example 402 Response:

{
    "code": "GEN-PAYMENT-REQUIRED",
    "message": "You have exceeded your monthly words quota [100000]. Please login to the dashboard and increase number of credits."
}

The 402 Payment Required response helps prevent unintentional overages by stopping further processing until you add credits or upgrade your plan. To avoid encountering this error, regularly check your quota status using the QUOTA endpoint and adjust your plan as necessary through the SharpAPI dashboard.

Best Practices

These utility endpoints, along with careful monitoring of quota status, will help you maintain a consistent and reliable experience with SharpAPI.


Blog

I’m probably going to ruffle some feathers here, but hear me out. 🙂


  ____  _                        _    ____ ___ 
 / ___|| |__   __ _ _ __ _ __   / \  |  _ \_ _|
 \___ \| '_ \ / _` | '__| '_ \ / _ \ | |_) | | 
  ___) | | | | (_| | |  | |_) / ___ \|  __/| | 
 |____/|_| |_|\__,_|_|  | .__/_/   \_\_|  |___|
                        |_|

Happy Coding! 🚀