generate

Generate new social post and rewrite post using ChatGPT

Creating the text for social media post can be difficult: writing the copy, hashtag, correct length, and emojis. Or if you have an existing social post and need variations — the social networks do not like duplicate posts.

The subdomain used for these calls is api.ayrshare.com instead of the standard app.ayrshare.com.

Max Pack Required.

Click the in the endpoint to view details.

POST Generate a Post Text

POST https://api.ayrshare.com/api/generate/post

Generate a new social post using ChatGPT. Token limits applicable.

Headers

NameTypeDescription

Authorization*

string

Format: Authorization: Bearer API_KEY. See Overview for more information.

Request Body

NameTypeDescription

text*

string

Description of what the post should be about. For example: "A shoe sale happening Monday with specials on red, blue, and yellow shoes".

hashtags

boolean

Default true. Add hashtags to the post.

emojis

boolean

Default false. Add emojis to the post.

twitter

boolean

Default false. Construct a post 280 or few characters.

{
    "status": "success",
    "post": "🎉🛍️ Introducing the stunning new shoes that's now on sale! You can choose from three different colors – red, blue, or purple – and trust us, they're all amazing! Don't miss out on this beauty and grab yours today! 🙌 #newshow #onSale #fashionable #colormebeautiful 🌈",
    "usage": 98,                // Tokens used for this call
    "totalMonthlyUsage": 733    // Total tokens used for the month
}

Request Examples

curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"text": "This beautiful new shoe is on sale now. It comes in red, blue, or purple. Check it out today."}' \
-X POST https://api.ayrshare.com/api/generate/post

POST Rewrite a Post

POST https://api.ayrshare.com/api/generate/rewrite

Generate variations of a social media posts using ChatGPT. Token limits applicable.

Headers

NameTypeDescription

Authorization*

string

Format: Authorization: Bearer API_KEY. See Overview for more information.

Request Body

NameTypeDescription

post*

string

The post text to be rewritten.

emojis

boolean

Default false. Add emojis to the post.

hashtags

boolean

Default false. Add hashtags to the post.

twitter

boolean

Default false. Construct a post 280 or few characters.

rewrites

int

Default 5. Number of rewrites. Min: 1 and Max: 5.

String

{
    "status": "success",
    "post": "Kali melts the heart, even when the rest of the day is freezing. Happy International Polar Bear Day to the largest land carnivore and the biggest, furriest part of the Zoo’s bear community! \nOur resident polar bear Kali (pronounced “Cully”) is a wild-born bear that was born off of the northwest coast of Alaska. He was named by the people of the Native Village of Point Lay, who rescued him. \"Kali\" is the Inupiaq name for Point Lay. Eventually, the U.S. Fish and Wildlife",
    "rewrites": [
        "❄️🐻 Kali, the lovable polar bear, warms our hearts on this #InternationalPolarBearDay. Fun fact: he was named after Inupiaq village, Point Lay! #FurryZooCommunity 🐾",
        "Happy #InternationalPolarBearDay to Kali, the largest land carnivore of the Zoo community! Even on freezing days, Kali steals our hearts with his adorable antics. 🐻❤️",
        "Meet Kali, the wild-born polar bear with a heart-melting charm. 🐾❄️ Sending love on this #InternationalPolarBearDay to the Zoo's fluffiest resident. 🐻❤️",
        "On #InternationalPolarBearDay, we celebrate Kali, the furry wonder from the largest land carnivore family of the Zoo. 🐾🐻 He was named after an Inupiaq village, Point Lay!🌟",
        "Kali, the Zoo's beloved polar bear, steals our hearts with his playful spirit, as we celebrate #InternationalPolarBearDay. 🐻❤️ Born off the Alaskan coast, he's a true warrior! 💪🌟"
    ],
    "usage": 98,                // Tokens used for this call
    "totalMonthlyUsage": 733    // Total tokens used for the month
}

Request Examples

curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"post": "Kali melts the heart, even when the rest of the day is freezing. Happy International Polar Bear Day to the largest land carnivore and the biggest, furriest part of the Zoo’s bear community! \nOur resident polar bear Kali (pronounced “Cully”) is a wild-born bear that was born off of the northwest coast of Alaska. He was named by the people of the Native Village of Point Lay, who rescued him. \"Kali\" is the Inupiaq name for Point Lay. Eventually, the U.S. Fish and Wildlife"}' \
-X POST https://api.ayrshare.com/api/generate/rewrite

POST Transcribe a Video

POST https://api.ayrshare.com/api/generate/transcription

Provide a transcription of a video file. This transcription can then be used in the /generate/post to create a social media summary of the video.

The video must have been previously upload to Ayrshare with /media. Videos not hosted by Ayrshare will be rejected.

Video max size 500GB and 10 minute duration.

Headers

NameTypeDescription

Authorization*

string

Format: Authorization: Bearer API_KEY. See Overview for more information.

Request Body

NameTypeDescription

videoUrl*

string

URL encoded video URL. The video must be hosted by Ayrshare.

{
    "status": "success",
    "transcript": "This is your last chance. After this, there is no turning back. You take the blue pill, the story ends you wake up in your bed and believe whatever you want to be you take the red pill. You stay in Wonderland. And I show you how deep the rabbit hole goes.",
    "transcriptArray": [
        "",
        "This is your last chance.",
        "After this, there is no turning back.",
        "You take the blue pill, the story ends you wake up in your bed and believe whatever you want to be you take the red pill. You stay in Wonderland.",
        "And I show you how deep the rabbit hole goes."
    ],
    "wordCount": 52
}

Request Examples

curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"videoUrl": "https://img.ayrshare.com/random/landscape5.mp4"}' \
-X POST https://api.ayrshare.com/api/generate/transcription

Transcribe Video Guide

Transcribe a Video

POST Translate Post Text

POST https://app.ayrshare.com/api/generate/translate

Translate text for a post to over 100 different languages. The current language is automatically detected and translated to the specified language.

Headers

NameTypeDescription

Authorization*

string

Format: Authorization: Bearer API_KEY. See Overview for more information.

Request Body

NameTypeDescription

text*

string

Text to be translated.

lang*

string

Language code to translate the text.

{
    "status": "success",
    "translatedText": "Nos vamos a las carreras",
    "originalText": "Off we go to the races",
    "language": "es"
}

POST Generate alt text for an image

POST https://api.ayrshare.com/api/generate/altText

Create AI-generated alt text for your images. Choose the language to write the alt text and keywords to include in the alt text.

Headers

NameTypeDescription

Authorization*

string

Format: Authorization: Bearer API_KEY. See Overview for more information.

Request Body

NameTypeDescription

url*

string

Image URL of the image to create the alt text. Must start with https://. Supports JPEG, PNG, GIF, WEBP, and BMP.

keywords

array

String array of keywords or phrases to be considered when generating the alt text. Typically only one or two of the keywords from the array will be used in the alt text.

lang

string

Language to output the alt text. Use one of the available language codes.

{
    "status": "success",
    "altText": "A ghostbusters vehicle driving through a field.",
    "url": "https://img.ayrshare.com/012/gb.jpg"
}

Request Examples

curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"url": "https://img.ayrshare.com/012/gb.jpg"}' \
-X POST https://api.ayrshare.com/api/generate/altText

Token Limits

For every API call made to ChatGPT endpoints, a certain number of "tokens" are used. These tokens are calculated based on the data you send and receive. Every month, your Max Pack and overall Ayrshare account are allocated a total of 300,000 tokens for Business plans, 100,000 for Premium Plus plans, and 50,000 for Premium plans. This allocation refreshes on the first day of each month. To see how many tokens a specific API call used, as well as your total usage for the month, please check the HTTP response.

Last updated