Docs
Relationship between two accounts

Relationship between two accounts

Whether one account follows another, and the other way round.

GET/user/friendships/show

Parameters

  • source_screen_namequery · string · required

    First handle, with or without @.

  • target_screen_namequery · string · required

    Second handle, with or without @.

Example request

curl 'https://api.twittrapi.com/user/friendships/show?source_screen_name=jack&target_screen_name=XDevelopers' \
  --header 'X-API-KEY: YOUR_API_KEY'

Base URL https://api.twittrapi.com, key in the X-API-KEY header. Python and Node.js use the official SDKs.

Response

Raw JSON of X's v1.1 friendships/show endpoint: relationship.source and relationship.target with following and followed_by.

Simple format (?format=simple or X-Response-Format: simple): {data: {source: {id, username}, target: {id, username}, following, followedBy, canDm, blocking, blockedBy, muting}}. following: source follows target. Schema.

{
  "relationship": {
    "source": {
      "id": 2244994945,
      "id_str": "2244994945",
      "screen_name": "XDevelopers",
      "following": true,
      "followed_by": false,
      "live_following": false,
      "following_received": null,
      "following_requested": null,
      "notifications_enabled": null,
      "can_dm": true,
      "can_media_tag": null,
      "blocking": null,
      "blocked_by": null,
      "muting": null,
      "want_retweets": null,
      "all_replies": null,
      "marked_spam": null
    },
    "target": {
      "id": 12,
      "id_str": "12",
      "screen_name": "jack",
      "following": false,
      "followed_by": true,
      "following_received": null,
      "following_requested": null
    }
  }
}

In the raw format, field names and nesting come from X and can change without notice. See Response format; the simple format keeps a fixed schema.

Errors

  • 400One of the two handles is missing.
  • 422One of the two handles is not 2 to 15 letters, digits or underscores.

Errors every endpoint can return (401, 402, 403, 404, 408, 409, 429, 5xx), and which of them are charged, are on the Errors page. Calls that fail with 400, 408, 409 or a 5xx error are refunded.