tap
Back

twitter/fxembed-trends

twitterRead-only

Fetch X / Twitter trending topics via FxEmbed

api.fxtwitter.com
Last 7 days
0
Last 30 days
0
All time
0
twitter/fxembed-trends.js
/* @meta
{
  "name": "twitter/fxembed-trends",
  "description": "Fetch X / Twitter trending topics via FxEmbed",
  "domain": "api.fxtwitter.com",
  "args": {
    "type": {"required": false, "description": "Explore timeline kind: trending"},
    "count": {"required": false, "description": "Number of trends, max 50"}
  },
  "runtime": "http",
  "readOnly": true,
  "example": "tap site twitter/fxembed-trends count=20"
}
*/

async function(args) {
  const params = [];
  if (args.type) params.push('type=' + encodeURIComponent(args.type));
  if (args.count) params.push('count=' + encodeURIComponent(args.count));

  let url = 'https://api.fxtwitter.com/2/trends';
  if (params.length) url += '?' + params.join('&');

  const resp = await fetch(url, {
    headers: {'accept': 'application/json'}
  });

  if (!resp.ok) return {error: 'HTTP ' + resp.status};

  return await resp.json();
}
Updated May 23, 2026Created May 23, 2026SHA-256: 855229a8a91d