Hashtagify Hashtags API

API Overview

The Hashtagify API lets you query data from the 40M+ hashtags in our Hashtags Finder, to get:

  1. The hashtag historical popularity
  2. The hashtag popularity for the last 2 months
  3. Its top related hashtags
  4. Its top influencers
  5. The top languages used with it
  6. Its top spelling variants (letter case)

The data is in a simple JSON format, and authentication is managed through OAuth 2.0.

API Endpoints

Currently we only have one endpoint, which retrieves the data about one single hashtag. If you would need other information not included here please feel free to contact us at api@hashtagify.me

Hashtag Info

This call will give you all the information about the hashtag #hashtag (you need to be authenticated - read below how) and its top 10 related hashtags:

https://api.hashtagify.me/1.0/tag/hashtag

You will receive a JSON response object which contains:

  • An entry for the requested hashtag
  • An entry for each top related hashtag

Related Hashtags API response json

The meaning of the data is explained in the Hashtags Find guide, while this is an explanation of the format:

name the lower-case name of this hashtag
popularity the 1-100 historical popularity of this hashtag
correlation the correlation with the searched hashtag, as a percentage - it's 100 for the hashtag itself
variants an array with the top spelling variants from the most used, with the percentage of usage, like: variants: [ ["hashtag",78.71], ["Hashtag",15.61], ["HASHTAG",3.18], ...]
languages an array with the top languages used with this hashtag, using the ISO 639 and starting from the most used, with the percentage of usage, like: languages: [ ["en",33], ["de",1.91], ["vi",1.57], ...]
top_influencers an array with the top influencers the most influential, with the measured generated impressions, like: top_influencers: [ ["LahirBulan",366105305], ["kelahiranku",136279472], ...
past_weeks an array with the popularity data for the past 8 weeks, starting from the last week, like: past_weeks: [ {"weeks_ago": 0,"popularity": 31.7}, {"weeks_ago": 1,"popularity": 26.5}, ...]

Data Not Available

When we don't have enough data about a hashtag in our finder, we return a 404 response code (resource not found). As we analyze more tweets, the data for the hashtag may become available later.

{ "code": 404, "error": "Not found", "error_description": "There isn't enough data yet for the requested hashtag" }

 

Usage and Authentication

To access the API, you can authenticate using the OAuth 2.0 protocol and go through a SSL connection (https). Authentication is done at the app level: you only need one consumer-key and consumer-secret for your app, not one for every user.

You can start testing our API for free in many ways:

Python (requests): Get the access ACCESS_TOKEN

import requests url = "https://api.hashtagify.me/oauth/token" payload = "grant_type=client_credentials&client_id=CONSUMER_KEY&client_secret=CONSUMER_SECRET" headers = { 'cache-control': "no-cache", 'content-type': "application/x-www-form-urlencoded" } response = requests.request("POST", url, data=payload, headers=headers) print(response.text)

response: { "token_type": "bearer", "access_token": ACCESS_TOKEN }

Python (requests): Use the ACCESS_TOKEN

import requests url = "https://api.hashtagify.me/1.0/tag/smm" headers = { 'authorization': "Bearer ACCESS_TOKEN", 'cache-control': "no-cache" } response = requests.request("GET", url, headers=headers) print(response.text)

response: {.. smm json data ..}

PHP (cURL): Get the access ACCESS_TOKEN

$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.hashtagify.me/oauth/token", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "grant_type=client_credentials&client_id=CONSUMER_KEY&client_secret=CONSUMER_SECRET", CURLOPT_HTTPHEADER => array( "cache-control: no-cache", "content-type: application/x-www-form-urlencoded" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

response: { "token_type": "bearer", "access_token": ACCESS_TOKEN }

PHP (cURL): Use the ACCESS_TOKEN

$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.hashtagify.me/1.0/tag/smm", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "authorization: Bearer ACCESS_TOKEN", "cache-control: no-cache" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

response: {.. smm json data ..}

Ruby (Net::HTTP): Get the access ACCESS_TOKEN

require 'uri' require 'net/http' url = URI("https://api.hashtagify.me/oauth/token") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Post.new(url) request["cache-control"] = 'no-cache' request["content-type"] = 'application/x-www-form-urlencoded' request.body = "grant_type=client_credentials&client_id=CONSUMER_KEY&client_secret=CONSUMER_SECRET" response = http.request(request) puts response.read_body

response: { "token_type": "bearer", "access_token": ACCESS_TOKEN }

Ruby (Net::HTTP): Use the ACCESS_TOKEN

require 'uri' require 'net/http' url = URI("https://api.hashtagify.me/1.0/tag/smm") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) request["authorization"] = 'Bearer ACCESS_TOKEN' request["cache-control"] = 'no-cache' response = http.request(request) puts response.read_body

response: {.. smm json data ..}

Ruby (OAuth2::Client): Get the access ACCESS_TOKEN

client = OAuth2::Client.new( CONSUMER_KEY, CONSUMER_SECRET, :site => 'https://api.hashtagify.me', :token_url => '/oauth/token' ) token = client.client_credentials.get_token

response: ACCESS_TOKEN

Ruby (OAuth2::Client): Use the ACCESS_TOKEN

response = token.get('1.0/tag/socialmedia') data = JSON.parse(response.body)

response: {.. smm json data ..}

NodeJS (unirest): Get the access ACCESS_TOKEN

var unirest = require("unirest"); var req = unirest("POST", "https://api.hashtagify.me/oauth/token"); req.headers({ "content-type": "application/x-www-form-urlencoded", "cache-control": "no-cache" }); req.form({ "grant_type": "client_credentials", "client_id": CONSUMER_KEY, "client_secret": CONSUMER_SECRET }); req.end(function (res) { if (res.error) throw new Error(res.error); console.log(res.body); });

response: { "token_type": "bearer", "access_token": ACCESS_TOKEN }

NodeJS (unirest): Use the ACCESS_TOKEN

var unirest = require("unirest"); var req = unirest("GET", "https://api.hashtagify.me/1.0/tag/smm"); req.headers({ "cache-control": "no-cache", "authorization": "Bearer ACCESS_TOKEN" }); req.end(function (res) { if (res.error) throw new Error(res.error); console.log(res.body); });

response: {.. smm json data ..}

NodeJS (request): Get the access ACCESS_TOKEN

var request = require("request"); var options = { method: 'POST', url: 'https://api.hashtagify.me/oauth/token', headers: { 'content-type': 'application/x-www-form-urlencoded', 'cache-control': 'no-cache' }, form: { grant_type: 'client_credentials', client_id: CONSUMER_KEY, client_secret: CONSUMER_SECRET } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(JSON.parse(body)); });

response: { "token_type": "bearer", "access_token": ACCESS_TOKEN }

NodeJS (request): Use the ACCESS_TOKEN

var request = require("request"); var options = { method: 'GET', url: 'https://api.hashtagify.me/1.0/tag/smm', headers: { 'cache-control': 'no-cache', authorization: 'Bearer ACCESS_TOKEN' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(JSON.parse(body)); });

response: {.. smm json data ..}

NodeJS: Get the access ACCESS_TOKEN

var qs = require("querystring"); var http = require("https"); var options = { "method": "POST", "hostname": "api.hashtagify.me", "port": null, "path": "/oauth/token", "headers": { "cache-control": "no-cache", "content-type": "application/x-www-form-urlencoded" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); var response = JSON.parse(body.toString()); console.log(response); }); }); req.write(qs.stringify({ grant_type: 'client_credentials', client_id: CONSUMER_KEY, client_secret: CONSUMER_SECRET })); req.end();

response: { "token_type": "bearer", "access_token": ACCESS_TOKEN }

NodeJS: Use the ACCESS_TOKEN

var http = require("https"); var options = { "method": "GET", "hostname": "api.hashtagify.me", "port": null, "path": "/1.0/tag/smm", "headers": { "authorization": "Bearer ACCESS_TOKEN", "cache-control": "no-cache" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); var response = JSON.parse(body.toString()); console.log(response); }); }); req.end();

response: {.. smm json data ..}

cURL: Get the access ACCESS_TOKEN

curl --request POST \ --url https://api.hashtagify.me/oauth/token \ --header 'cache-control: no-cache' \ --header 'content-type: application/x-www-form-urlencoded' \ --data 'grant_type=client_credentials&client_id=CONSUMER_KEY&client_secret=CONSUMER_SECRET'

response: { "token_type": "bearer", "access_token": ACCESS_TOKEN }

cURL: Use the ACCESS_TOKEN

curl --request GET \ --url https://api.hashtagify.me/1.0/tag/smm \ --header 'authorization: Bearer ACCESS_TOKEN' \ --header 'cache-control: no-cache'

response: {.. smm json data ..}

Limits and pricing

Each subscription has both a hourly and a daily limit. For test API access, the limits are:

  1. Hourly limit: 100 requests/hour
  2. Daily limit: 100 requests/day

You can find the limits for each paid API plan here: API pricing page

If your app exceeds any of these rate limits, you will receive a response with an HTTP response code of 429 (Too Many Requests). The body of the response will consist of the following fields:

Field Value
code 429
error rate_limit_exceeded
error_description The daily or hourly quota has been exceeded.

The limits are reset every hour (hourly limit) and every day ad midnight GMT (daily limit).

You may also receive responses with an HTTP response code of 400 (Bad Request) if we detect spammy behavior by a person using your app. These errors are unrelated to rate limiting.

Questions? Write to api@hashtagify.me!

Share Chart