# getTrends

**Identifier:** `x_getTrends`

**Provider:** [X (formerly Twitter)](https://kirha.com/providers/x.md)

Get trending topics on X for a specific location.

## Run it with the CLI

```bash
kirha tools run x_getTrends \
  --input '{}'
```

`--input` takes a JSON object that matches the input schema. Pass `--input -` to read it from stdin.

## Call it over HTTP

```bash
curl https://api.kirha.com/tools/v1/execute \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: **********' \
  --data '{
  "tool_name": "x_getTrends",
  "input": {}
}'
```

Replace the stars with an API key from https://app.kirha.com/api-keys.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "location": {
      "default": "worldwide",
      "enum": [
        "worldwide",
        "united_states",
        "united_kingdom",
        "france",
        "germany",
        "japan",
        "brazil",
        "india",
        "canada",
        "australia"
      ],
      "type": "string"
    },
    "maxTrends": {
      "default": 1,
      "maximum": 5,
      "minimum": 1,
      "type": "number"
    },
    "woeid": {
      "description": "Yahoo WOEID, overrides location if provided",
      "type": "number"
    }
  },
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "context": {
      "type": "string"
    },
    "trends": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "postCount": {
            "type": "number"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "context",
    "trends"
  ],
  "type": "object"
}
```

-----

[All X (formerly Twitter) tools](https://kirha.com/providers/x.md) · [< Back to tools list](https://kirha.com/tools.md)