> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sorsa.io/llms.txt
> Use this file to discover all available pages before exploring further.

# ユーザー名からユーザーIDへ変換

> Twitter/Xユーザー名を対応する永続的な数値IDに変換します。ユーザー名と異なりIDは変わらないため、長期保存やデータ間の照合に適しています。



## OpenAPI

````yaml /openapi-ja.json get /username-to-id/{user_handle}
openapi: 3.0.3
info:
  contact: {}
  title: Sorsa.io API
  version: '3.0'
servers:
  - url: https://api.sorsa.io/v3
security: []
paths:
  /username-to-id/{user_handle}:
    get:
      tags:
        - ユーティリティ
      summary: ユーザー名からユーザーIDへ変換
      description: >-
        Twitter/Xユーザー名を対応する永続的な数値IDに変換します。ユーザー名と異なりIDは変わらないため、長期保存やデータ間の照合に適しています。
      parameters:
        - description: user_handleは必須
          in: path
          name: user_handle
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/technical.IDRes'
          description: 成功
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponse'
          description: 不正なリクエスト
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponse'
          description: 認証失敗
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponse'
          description: アクセス拒否
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponse'
          description: 見つかりません
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponse'
          description: リクエスト過多
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponse'
          description: 内部サーバーエラー
      security:
        - ApiKeyAuth: []
components:
  schemas:
    technical.IDRes:
      properties:
        id:
          description: 数値のTwitter/XユーザーID。
          example: '1'
          type: string
      type: object
    handler.ErrorResponse:
      properties:
        message:
          type: string
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: ApiKey
      type: apiKey

````