auto-hashtag

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

post
Auto Hashtags

https://app.ayrshare.com/api/auto-hashtag
Automatically add hashtags to your post. Maximum post length is 1,000 characters. If over limit, hashtags will not be added.
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 hashtags. Max length 1,000 characters.
position
optional
string
Values: "auto" or "end". "end" hashtags at the end of the text, "auto" hashtags anywhere in the text or at the end. Default "auto".
max
optional
number
Integer of max number of Hashtags to add. Max value range 1 to 5. Default 2.
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!", "max": 3, "position": "auto"}
-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
max: 3, // optional, range 1-5
position: "auto" // optional, "auto" or "end"
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
Python
import requests
payload = {
'post': 'Today is a great day!',
'max': 3, # optional, range 1-5
'position': 'auto' # optional, 'auto' or 'end'
}
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!',
'max' => 3,
'position' => 'auto'
]
]
);
echo json_encode(json_decode($res->getBody()), JSON_PRETTY_PRINT);