{
  "openapi": "3.1.0",
  "info": {
    "title": "Twitter API — Profile",
    "version": "1.0.0",
    "description": "User profile metadata and account context."
  },
  "servers": [
    {
      "url": "https://api.fetchlayer.dev/twitter"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Key",
        "description": "Send your FetchLayer key as Authorization: Bearer ss-your-key."
      }
    }
  },
  "paths": {
    "/user-profile-details": {
      "post": {
        "operationId": "user-profile-details",
        "tags": [
          "Profile"
        ],
        "summary": "Fetch a user profile by handle",
        "description": "Retrieve a Twitter user profile and top-level account metadata by handle. Includes bio, follower/following counts, join date, and verification status.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "handle": {
                    "type": "string",
                    "description": "Twitter handle without @."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "handle"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "handle": "openai"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "handle": {
                      "type": "string",
                      "description": "Twitter handle."
                    },
                    "displayName": {
                      "type": "string",
                      "description": "Display name."
                    },
                    "description": {
                      "type": "string",
                      "description": "Bio text."
                    },
                    "isVerified": {
                      "type": "boolean",
                      "description": "Verification status."
                    },
                    "followersCount": {
                      "type": "number",
                      "description": "Follower count."
                    },
                    "followingCount": {
                      "type": "number",
                      "description": "Following count."
                    },
                    "tweetsCount": {
                      "type": "number",
                      "description": "Total tweet count."
                    },
                    "joinedAt": {
                      "type": "string",
                      "description": "Account creation timestamp (ISO 8601)."
                    },
                    "location": {
                      "type": "string",
                      "description": "Profile location (optional)."
                    },
                    "website": {
                      "type": "string",
                      "description": "Profile website URL (optional)."
                    },
                    "avatarUrl": {
                      "type": "string",
                      "description": "Profile image URL."
                    },
                    "bannerUrl": {
                      "type": "string",
                      "description": "Header banner URL (optional)."
                    }
                  },
                  "additionalProperties": false
                },
                "examples": {
                  "default": {
                    "value": {
                      "handle": "OpenAI",
                      "displayName": "OpenAI",
                      "description": "AI research and deployment company. Creators of ChatGPT, GPT-4, DALL·E, and Sora.",
                      "isVerified": true,
                      "followersCount": 4300000,
                      "followingCount": 82,
                      "tweetsCount": 3400,
                      "joinedAt": "2015-12-11T00:00:00.000Z",
                      "location": "San Francisco, CA",
                      "website": "https://openai.com",
                      "avatarUrl": "https://pbs.twimg.com/profile_images/openai_normal.jpg",
                      "bannerUrl": "https://pbs.twimg.com/profile_banners/openai_header.jpg"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/about-profile": {
      "post": {
        "operationId": "about-profile",
        "tags": [
          "Profile"
        ],
        "summary": "Fetch “about this profile” metadata",
        "description": "Retrieve extended profile context for a Twitter account including professional category, and any linked entities.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "handle": {
                    "type": "string",
                    "description": "Twitter handle without @."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "handle"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "handle": "openai"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "handle": {
                      "type": "string",
                      "description": "Twitter handle."
                    },
                    "category": {
                      "type": "string",
                      "description": "Professional category label."
                    },
                    "isBusiness": {
                      "type": "boolean",
                      "description": "Whether the account is marked as a business."
                    },
                    "isGovernment": {
                      "type": "boolean",
                      "description": "Whether the account is marked as a government entity."
                    },
                    "affiliates": {
                      "type": "array",
                      "description": "Affiliated accounts or entities.",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    }
                  },
                  "additionalProperties": false
                },
                "examples": {
                  "default": {
                    "value": {
                      "handle": "OpenAI",
                      "category": "Technology",
                      "isBusiness": true,
                      "isGovernment": false,
                      "affiliates": []
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    }
  }
}