auto-hashtag

Automatically add hashtags to your posts based on the most relevant key words. Takes into account real-time hashtag popularity. Premium or Business Plan required.

post
auto-hashtag

https://app.ayrshare.com/api/auto-hashtag
Request
Response
Request
Headers
Authorization
required
string
Format: Authorization: Bearer API _KEY. See Overview for more information.
Body Parameters
post
required
string
Post text to add the relevant hashtags.
maxHashtags
optional
number
Integer of max number of Hashtags to add. Max must be <5 and >0.
Response
200: OK
Returns the hashtagged post
{
post: "Disney’s trouble with Oswald the #LuckyRabbit is a great lesson #ForStartups in a crisis"
}

Request Examples

cURL
Node.js
Python
PHP
cURL
curl \
-H "Authorization: Bearer API_Key" \
-d '{"post": "Today is a great day!", "maxHashtags": 2}
-X POST https://app.ayrshare.com/api/auto-hashtag
Node.js
const fetch = require("node-fetch");
const API_KEY = "API_KEY";
fetch(`https://app.ayrshare.com/api/auto-hashtag?post=${post}`, {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`
},
body: JSON.stringify({
post: "Today is a great day!", // required
maxHashtags: 2 // optional
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
Python
import requests
payload = {
'post': 'Today is a great day!',
'maxHashtags': 2
}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY'}
r = requests.post('https://app.ayrshare.com/api/auto-hashtag',
json=payload,
headers=headers)
print(r.json())
PHP
<?php
require 'vendor/autoload.php'; // Composer auto-loader
$client = new GuzzleHttp\Client();
$res = $client->request(
'POST',
'https://app.ayrshare.com/api/auto-hashtag',
[
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer API_KEY'
],
'json' => [
'post' => 'Today is a great day!',
"maxHashtags" => 2
]
]
);
echo json_encode(json_decode($res->getBody()), JSON_PRETTY_PRINT);