cURL
curl --request GET \
--url 'https://api.keyapi.ai/v1/twitter/top_posts?type=Likes&country=ALL&period=Monthly' \
--header 'Authorization: Bearer <YOUR_API_KEY>'import requests
response = requests.get(
'https://api.keyapi.ai/v1/twitter/top_posts',
params={"type": "Likes", "country": "ALL", "period": "Monthly"},
headers={'Authorization': 'Bearer <YOUR_API_KEY>'}
)
print(response.json())const params = new URLSearchParams({"type": "Likes", "country": "ALL", "period": "Monthly"});
const response = await fetch(`https://api.keyapi.ai/v1/twitter/top_posts?${params}`, {
method: 'GET',
headers: { 'Authorization': 'Bearer <YOUR_API_KEY>' }
});
const data = await response.json();
console.log(data);HttpResponse<String> response = Unirest.get("https://api.keyapi.ai/v1/twitter/top_posts")
.header("Authorization", "Bearer <token>")
.asString();{
"code": 0,
"message": "success",
"data": {
"timeline": [],
"next_cursor": null
},
"requestId": "1f1a3c4a-8f50-4aa9-9e2b-9526fbc060db"
}{
"code": 400,
"data": null,
"message": "Missing required parameter: handle"
}{
"code": 401,
"data": null,
"message": "apiKey is null"
}{
"code": 402,
"data": null,
"message": "apiKey quota is not enough"
}{
"code": 429,
"data": null,
"message": "qps limit exceeded"
}{
"code": 500,
"data": null,
"message": "Internal server error"
}API Reference
Inspiration Posts
Retrieve Twitter / X popular or inspiration content by type, country, and time period. Useful for content ideation, hot content discovery, and creative reference.
GET
/
v1
/
twitter
/
top_posts
cURL
curl --request GET \
--url 'https://api.keyapi.ai/v1/twitter/top_posts?type=Likes&country=ALL&period=Monthly' \
--header 'Authorization: Bearer <YOUR_API_KEY>'import requests
response = requests.get(
'https://api.keyapi.ai/v1/twitter/top_posts',
params={"type": "Likes", "country": "ALL", "period": "Monthly"},
headers={'Authorization': 'Bearer <YOUR_API_KEY>'}
)
print(response.json())const params = new URLSearchParams({"type": "Likes", "country": "ALL", "period": "Monthly"});
const response = await fetch(`https://api.keyapi.ai/v1/twitter/top_posts?${params}`, {
method: 'GET',
headers: { 'Authorization': 'Bearer <YOUR_API_KEY>' }
});
const data = await response.json();
console.log(data);HttpResponse<String> response = Unirest.get("https://api.keyapi.ai/v1/twitter/top_posts")
.header("Authorization", "Bearer <token>")
.asString();{
"code": 0,
"message": "success",
"data": {
"timeline": [],
"next_cursor": null
},
"requestId": "1f1a3c4a-8f50-4aa9-9e2b-9526fbc060db"
}{
"code": 400,
"data": null,
"message": "Missing required parameter: handle"
}{
"code": 401,
"data": null,
"message": "apiKey is null"
}{
"code": 402,
"data": null,
"message": "apiKey quota is not enough"
}{
"code": 429,
"data": null,
"message": "qps limit exceeded"
}{
"code": 500,
"data": null,
"message": "Internal server error"
}🪙1 creditsper request
Copy for AI
🤖 Why Code When AI Can Do It For You?
Stop writing code like it’s 1970! Let AI do the heavy lifting - click the sparkles to copy a perfectly formatted prompt for ChatGPT, Claude, or your favorite AI assistant.
Authorizations
Query Parameters
Available options:
Likes, Replies, Quotes, Bookmarks, Shares, VideoQuality Views Available options:
ALL, USA, FRA, AFG, ALB, DZA, AND, AGO, ATG, ARG, ARM, AUS, AUT, AZE, BHS, BHR, BGD, BRB, BLR, BEL, BLZ, BEN, BTN, BOL, BIH, BWA, BRA, BRN, BGR, BFA, BDI, KHM, CMR, CAN, CPV, CAF, TCD, CHL, CHN, COL, COM, COG, CRI, CIV, HRV, CUB, CYP, CZE, DNK, DJI, DMA, DOM, ECU, EGY, SLV, GNQ, ERI, EST, SWZ, ETH, FJI, FIN, GAB, GMB, GEO, DEU, GHA, GRC, GRD, GTM, GIN, GNB, GUY, HTI, HND, HUN, ISL, IND, IDN, IRN, IRQ, IRL, ISR, ITA, JAM, JPN, JOR, KAZ, KEN, KIR, KWT, KGZ, LAO, LVA, LBN, LSO, LBR, LBY, LIE, LTU, LUX, MDG, MWI, MYS, MDV, MLI, MLT, MHL, MRT, MUS, MEX, FSM, MDA, MCO, MNG, MNE, MAR, MOZ, MMR, NAM, NRU, NPL, NLD, NZL, NIC, NER, NGA, MKD, NOR, OMN, PAK, PLW, PAN, PNG, PRY, PER, PHL, POL, PRT, QAT, ROU, RUS, RWA, KNA, LCA, VCT, WSM, SMR, STP, SAU, SEN, SRB, SYC, SLE, SGP, SVK, SVN, SLB, SOM, ZAF, SSD, ESP, LKA, SDN, SUR, SWE, CHE, SYR, TJK, TZA, THA, TLS, TGO, TON, TTO, TUN, TUR, TKM, TUV, UGA, UKR, ARE, GBR, URY, UZB, VUT, VEN, VNM, YEM, ZMB, ZWE Available options:
Daily, Weekly, Monthly Response
The response is of type object.

