generate

Generate new social post and rewrite post using AI

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 AI. You can either provide text or images to create the social media post. Token limits applicable.

Headers

Request Body

{
    "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 AI. Token limits applicable.

Headers

Request Body

{
    "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 and title of a video file using AI. This transcription can then be used in the /generate/post to create a social media summary of the video. The title can be used for post the video, such a for YouTube which requires a title.

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

Request Body

{
    "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."
    ],
    "videoTitle": "Choose Wisely: Blue Pill or Red Pill Adventure Awaits!",
    "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


POST Translate Post Text

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

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

Headers

Request Body

{
    "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

Request Body

{
    "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


POST Generate Sentiment Analysis

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

Generate a sentiment analysis on a social media post or comment to understand if the text is positive, negative, or neutral and recommendations on improving the text for a more positive reaction.

Headers

Request Body

{
    "status": "success",
    "text": "These shoes aren't the best. The color has faded and they are uncomfortable to walk in.",
    "sentimentAnalysis": {
        "sentiment": "negative", // positive, negative, or neutral
        "opportunities": [
            "Improve color durability",
            "Enhance comfort level"
        ],
        "recommendations": [
            {
                "opportunity": "Improve color durability",
                "recommendation": "Investigate and use higher-quality dyes or materials to prevent fading over time."
            },
            {
                "opportunity": "Enhance comfort level",
                "recommendation": "Review and possibly redesign the shoe's insole and cushioning to provide better support and comfort for walking."
            }
        ]
    }
}

Request Examples

curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"text": "These shoes aren't the best. The color has faded and they are uncomfortable to walk in."}' \
-X POST https://api.ayrshare.com/api/generate/sentiment

Token Limits

For every API call made to AI 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