{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"14c31f7f-8837-404b-b8f6-6d847096159d","name":"SharpAPI.com: Automate workflows with AI-powered API - Summary","description":"## Leverage AI API to streamline workflows in E-Commerce, Marketing, Content Management, HR Tech, Travel, and more.\n\nEasy-to-use REST API endpoints to help automate your app AI content processing whether it's: [E-commerce](http://sharpapi.com/#ecommerce), [HR Tech](http://sharpapi.com#hr), [Travel, Tourism &amp; Hospitality](http://sharpapi.com/#tth), [Content](http://sharpapi.com/#content), or [SEO](http://sharpapi.com/#seo).\n\n---\n\n## SDK Client Packages - Super Fast Integration\n\nCheck [https://github.com/sharpapi/](https://github.com/sharpapi/) for the latest versions of the SDK for your framework (Node, Laravel, PHP, Python, .NET, FLutter and others).\n\n---\n\n## Easy-to-Use RESTful Format\n\n- A standardized set of endpoints at your service.\n    \n- Always returning data in the same predictable JSON format.\n    \n- Analysis endpoints (like product categories, skills, and job positions) providing valuable relevance scores.\n    \n- No need to worry about returned fuzzy AI data.\n    \n\n---\n\n#### Multi-Language Support\n\nSharpAPI supports 80 languages for every content or data analysis API endpoint. [Check the list here.](https://botpress.com/blog/list-of-languages-supported-by-chatgpt)\n\n---\n\n## **Authorization**\n\nWe use the Bearer Authorization method. [More at swagger.io.](https://swagger.io/docs/specification/authentication/bearer-authentication/)\n\n``` plaintext\nAuthorization: Bearer\n\n ```\n\n---\n\n## **Accept Header**\n\nAll requests must also contain a header:\n\n``` plaintext\nAccept: application/json\n\n ```\n\n---\n\n## Usage of Utilities Endpoints / Non-AI\n\n- All Utility type endpoints are based on simple GET REST API requests, where the processing response is provided immediately.\n    \n- All these endpoints have a flat price based on the user's selected [pricing package](https://sharpapi.com/pricing).\n    \n\n---\n\n## Usage of AI-Powered Endpoints\n\nSharpAPI uses polling as the basic technique for requesting our AI processing jobs, now supplemented by **webhooks for real-time notifications**.\n\n---\n\n### Webhooks for Real-Time Notifications\n\nSharpAPI now supports webhooks to deliver job results directly to your application in real-time, eliminating the need for continuous polling.\n\n#### **Setting Up Webhooks**\n\n1. **Enable Webhooks**  \n    Visit your [<b>Webhooks Management Dashboard</b>](https://sharpapi.com/dashboard/webhooks) and toggle the **Enable Webhooks** switch.\n    \n2. **Configure Your Webhook URL**  \n    Provide a publicly accessible HTTPS URL capable of receiving POST requests and returning HTTP 200 status codes.\n    \n3. **Set Secret for Signature**  \n    Define a unique **Secret for Signature** to sign payloads, ensuring they are securely verifiable.\n    \n4. **Include AI Job Results** (Optional)  \n    Check the option to include the AI job result in the webhook payload under the `result` parameter.\n    \n5. **AI Job-Level Webhooks**  \n    Add the `Job-Webhook` header with a webhook URL when dispatching a job to configure notifications for individual jobs.\n    \n\n---\n\n### Polling Mode\n\nPolling requires three steps to request and obtain results for your jobs:\n\n#### **STEP 1. Dispatch a Job**\n\nMake a POST request to your endpoint, e.g., `https://sharpapi.com/api/v1/content/paraphrase`.\n\n#### **STEP 2. Check Job Status**\n\nKeep checking the job status using the provided `status_url` until it is complete.\n\n#### **STEP 3. Fetch Results**\n\nFetch the final results when the job status is `success` or handle errors if the status is `failed`.\n\n---\n\n### Webhooks Mode\n\nOnce webhooks are enabled, SharpAPI sends job results directly to your Webhook URL.\n\n#### Example Webhook Payload\n\nBasic payload:\n\n``` json\n{\n    \"id\": \"bf683177-3a48-47d1-9c4e-0b4de39517fa\",\n    \"status\": \"success\",\n    \"type\": \"content_translate\"\n}\n\n ```\n\nWith `Include AI Job Results` enabled:\n\n``` json\n{\n    \"id\": \"bf683177-3a48-47d1-9c4e-0b4de39517fa\",\n    \"status\": \"success\",\n    \"type\": \"content_translate\",\n    \"result\": {\n        \"content\": \"ciao\",\n        \"from_language\": \"English\",\n        \"to_language\": \"Italian\"\n    }\n}\n\n ```\n\n---\n\n## Usage of AI-powered Endpoints in Polling Mode\n\nSharpAPI uses polling as the basic technique for requesting our AI processing jobs.\n\nEach type of job has its request endpoint and arrays of parameters allowed.\n\nOn the lowest level, it requires 3 steps to request and obtain processing results.\n\n### STEP 1. Make a POST request to dispatch an AI job for processing\n\nFor example `https://sharpapi.com/api/v1/content/paraphrase`\n\nThis is the example **BODY** of the request:\n\n``` json\n    {\n        \"content\": \"Red Bull's Max Verstappen says this weekend's Las Vegas Grand Prix is \\\"99% show and 1% sporting event\\\". \\n\\n The triple world champion said he is \\\"not looking forward\\\" to the razzmatazz around the race, the first time Formula 1 cars have raced down the city's famous Strip. \\n\\n Other leading drivers were more equivocal about the hype.\\n\\n Aston Martin's Fernando Alonso said: \\\"With the investment that has been made and the place we are racing, it deserves a little bit [of] different treatment and extra show.\\\" \\n\\n The weekend was kick-started on Wednesday evening with a lavish opening ceremony.\\n\\n It featured performances from several music stars, including Kylie Minogue and Journey, and culminated in the drivers being introduced to a sparsely populated crowd in light rain by being lifted into view on hydraulic platforms under a sound-and-light show. \\n\\n Lewis Hamilton said: \\\"It's amazing to be here. It is exciting - such an incredible place, so many lights, a great energy, a great buzz. \\n\\n \\\"This is one of the most iconic cities there is. It is a big show, for sure. It is never going to be like Silverstone [in terms of history and purity]. But maybe over time the people in the community here will grow to love the sport.\\\" \\n\\n Hamilton added: \\\"It is a business, ultimately. You'll still see good racing here. \\n\\n \\\"Maybe the track will be good, maybe it will be bad. It was so-so on the [simulator]. Don't knock it 'til you try it. I hear there are a lot of people complaining about the direction [F1 president] Stefano [Domenicali] and [owners] Liberty have been going [but] I think they have been doing an amazing job b.\\\"\",\n        \"max_length\":500,\n        \"language\":\"English\",\n        \"voice_tone\":\"David Attenborough alike\",\n        \"context\": \"replace Lewis first name with Bob\"\n    }\n\n ```\n\nAPI will return similar response headers:\n\n```\nHTTP/1.1 202 Accepted\nRetry-After: 10\n\n ```\n\nAdditionally, the response text will also contain the job status URL.\n\n``` json\n{\n    \"status_url\": \"https://sharpapi.com/api/v1/content/paraphrase/job/status/5de4887a-0dfd-49b6-8edb-9280e468c210\",\n    \"job_id\": \"5de4887a-0dfd-49b6-8edb-9280e468c210\"\n}\n\n ```\n\nAll POST API endpoints will return the same set of headers and body.\n\n### STEP 2. Check job progress & get results\n\nUsing Retry-After response header values keep checking the requested job while its status is `pending`.\n\nGET: `https://sharpapi.com/api/v1/content/paraphrase/job/status/5de4887a-0dfd-49b6-8edb-9280e468c210`\n\nThe API should return similar response:\n\n``` json\n{\n  \"data\": {\n    \"type\": \"api_job\",\n    \"id\": \"385fec60-e73e-458c-a6c9-6e76e5a76661\",\n    \"attributes\": {\n      \"status\": \"pending\",\n      \"type\": \"content_paraphrase\"\n    }\n  }\n}\n\n ```\n\nThe final response format will be delivered when the status becomes `success` or `failed`.\n\n**A successful response format will look like this:**\n\n``` json\n{\n    \"data\": {\n        \"type\": \"api_job_result\",\n        \"id\": \"385fec60-e73e-458c-a6c9-6e76e5a76661\",\n        \"attributes\": {\n            \"status\": \"success\",\n            \"type\": \"content_paraphrase\",\n            \"result\": {\n                \"paraphrase\": \"Max Verstappen of Red Bull remarks that the Las Vegas Grand Prix is '99% show and 1% sport.' The triple world champion isn't thrilled about the spectacle, marking the first F1 race on the city's Strip. Other drivers, like Fernando Alonso, acknowledge the unique investment and setting. The event began with a grand ceremony featuring stars like Kylie Minogue. Bob Hamilton expressed excitement about the iconic city, noting the blend of show and sport, and praised F1's direction under Stefano Domenicali and Liberty.\"\n            }\n        }\n    }\n}\n\n ```\n\nThe `result` field will contain processing output in escaped JSON format.\n\nOn a very rare occasion, the job processing might fail and the resulting response will look like this:\n\n``` json\n{\n  \"data\": {\n    \"type\": \"api_job\",\n    \"id\": \"b08a921f-aaa0-43d9-be08-e4921d41ef34\",\n    \"attributes\": {\n      \"status\": \"failed\",\n      \"type\": \"content_paraphrase\"\n    }\n  }\n}\n\n ```\n\nIn this case, we encourage you to rerun the request, AI engines sometimes tend to be a bit capricious, return some hallucinations or throw connection exceptions for that matter. And for the sake of making sure you always get properly formatted JSON with requested response data - we gracefully fail your job so your app can try again.\n\n**We do not charge our customers for failed API jobs, your assigned word-processing quota will stay the same.**\n\n## Errors\n\n| Error                     | Details                                                                                                                                                                                                            |\n| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| 401 Unauthorized          | Please check your API Key for validity                                                                                                                                                                             |\n| 402 Payment Required      | You have exceeded your monthly word quota. Please login to the dashboard and increase the number of credits.                                                                                                       |\n| 422 Unprocessable Content | Input parameters validation error, check the provided request body for missing or incorrect parameter values                                                                                                       |\n| 429 Too Many Requests     | Rate limiting is in effect, too many requests per minute are generated for the provided API key. Please check the values of the headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset & Retry-After |\n| 500 Internal Server Error | Our server admin has been informed via the bug tracking system, and we're working on the backend issue. Please try again later                                                                                     |\n| 503 Service Unavailable   | Service is temporarily unavailable - please rerun the request in a couple of seconds.                                                                                                                              |\n\n> **Workspace access**  \n> This Postman workspace is not open for collaboration.  \n> You do not need to join the workspace to use the API.  \n> Please use the public documentation and import the collection for your own use.  \n> Join requests will not be approved.\n","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"31106842","team":6831768,"collectionId":"14c31f7f-8837-404b-b8f6-6d847096159d","publishedId":"2s9Ye8faUp","public":true,"publicUrl":"https://documenter-api.postman.tech/view/31106842/2s9Ye8faUp","privateUrl":"https://go.postman.co/documentation/31106842-14c31f7f-8837-404b-b8f6-6d847096159d","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"3F83F8"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":"Leverage AI API to streamline workflows in E-Commerce, Marketing, Content Management, HR Tech, Travel, and more.\nSave countless hours and enhance your app effortlessly."},{"name":"title","value":"Automate with AI in just two lines of code"}],"appearance":{"default":"light","themes":[{"name":"dark","logo":"https://content.pstmn.io/b98f1b83-d95a-4132-be5b-61a0bf293268/bG9nbzYwMC1zcXVhcmUtdHJhbnNwYXJlbnQucG5n","colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"3F83F8"}},{"name":"light","logo":"https://content.pstmn.io/b98f1b83-d95a-4132-be5b-61a0bf293268/bG9nbzYwMC1zcXVhcmUtdHJhbnNwYXJlbnQucG5n","colors":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"3F83F8"}}]}},"version":"8.10.1","publishDate":"2024-07-18T17:06:08.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"Automate with AI in just two lines of code","description":"Leverage AI API to streamline workflows in E-Commerce, Marketing, Content Management, HR Tech, Travel, and more.\nSave countless hours and enhance your app effortlessly."},"logos":{"logoLight":"https://content.pstmn.io/b98f1b83-d95a-4132-be5b-61a0bf293268/bG9nbzYwMC1zcXVhcmUtdHJhbnNwYXJlbnQucG5n","logoDark":"https://content.pstmn.io/b98f1b83-d95a-4132-be5b-61a0bf293268/bG9nbzYwMC1zcXVhcmUtdHJhbnNwYXJlbnQucG5n"}},"statusCode":200},"environments":[{"name":"Production","id":"41f05ecb-f32e-4959-b47b-3f8058e4595a","owner":"31106842","values":[{"key":"API_URL","value":"https://sharpapi.com/","enabled":true,"type":"default"},{"key":"API_KEY","value":"","enabled":true,"type":"secret"},{"key":"last_job_result","value":"","enabled":true,"type":"any"},{"key":"job_id","value":"","enabled":true,"type":"any"},{"key":"status_url","value":"","enabled":true,"type":"any"},{"key":"job_status","value":"","enabled":true,"type":"any"},{"key":"poll_attempts","value":"","enabled":true,"type":"any"},{"key":"","value":"","enabled":true,"type":"default"}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/b083f518f793175ae90fc960666eb3591177683ee6698986f878ad8f17e33914","favicon":"https://res.cloudinary.com/postman/image/upload/v1753163656/team/29163a1dff0bbe79065d4ab6d2a953ac.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"Production","value":"31106842-41f05ecb-f32e-4959-b47b-3f8058e4595a"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/2s9Ye8faUp"}