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

# 通过 ID 获取活动详情

<div className="inline-flex items-center gap-2 px-4 py-2 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg">
  <span className="text-base">🪙</span>
  <span className="text-sm font-medium text-yellow-900 dark:text-yellow-100"><span className="font-semibold">4 credits</span><span className="text-yellow-700 dark:text-yellow-300 ml-1">每次请求</span></span>
</div>

## 复制给 AI

<div className="my-6 rounded-xl border border-gray-200 bg-gray-50 p-5 dark:border-gray-800 dark:bg-gray-900/40">
  <div className="min-w-0">
    <p className="text-base font-semibold text-gray-900 dark:text-gray-100">🤖 为什么还要自己写代码？</p>
    <p className="mt-1 text-sm text-gray-700 dark:text-gray-300">让 AI 来处理重复工作。点击按钮即可复制一段整理好的提示词，用于 ChatGPT、Claude 或你常用的 AI 助手。</p>
  </div>

  <div className="mt-4">
    <button
      type="button"
      className="inline-flex items-center gap-2 rounded-md border border-emerald-300 bg-emerald-50 px-3 py-2 text-sm font-medium text-emerald-800 hover:bg-emerald-100 dark:border-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-100 dark:hover:bg-emerald-900/50"
      onClick={() => navigator.clipboard.writeText(`我需要调用下面的 KeyAPI 接口，请根据提供的接口信息生成一份完整、可直接运行的 Python 示例代码。

## 接口信息

Endpoint: GET https://api.keyapi.ai/v1/facebook/event_details_id
摘要: 通过 ID 获取活动详情

必需请求头:
- Authorization: Bearer <YOUR_API_KEY>

参数:
- event_id (必填): Facebook 活动 ID. 示例: 1259800548576578

## 代码要求

- 使用 Python \`requests\` 库
- 提供完整、可直接运行的示例
- 处理 HTTP 请求异常、超时以及非 2xx 响应
- 处理 JSON 解析异常
- 示例参数优先使用接口信息中提供的 Example
- 保持代码简单，避免不必要的封装和复杂设计`)}
    >
      <span>✨</span>
      <span>复制给 AI</span>
    </button>
  </div>
</div>


## OpenAPI

````yaml /zh/facebook.zh.openapi.json get /v1/facebook/event_details_id
openapi: 3.0.1
info:
  title: KeyAPI Facebook API 中文文档
  description: KeyAPI Facebook API 的中文参考文档，包含接口用途、参数说明、响应状态和示例结构。
  version: 1.0.0
servers:
  - url: https://api.keyapi.ai
    description: Production-KeyAPI
security:
  - JWT Bearer: []
tags:
  - name: 公共主页
  - name: 个人主页
  - name: 群组
  - name: 帖子与评论
  - name: 广告库
  - name: 活动
  - name: 搜索
  - name: Marketplace
  - name: 游戏
paths:
  /v1/facebook/event_details_id:
    get:
      tags:
        - 活动
      summary: 通过 ID 获取活动详情
      parameters:
        - name: event_id
          in: query
          description: Facebook 活动 ID。
          required: true
          example: '1259800548576578'
          schema:
            type: string
            example: '1259800548576578'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
              example:
                code: 0
                message: success
                data:
                  event:
                    stats: ok
                    event_id: '1259800548576578'
                    start_date: '2025-02-14'
                    start_time: '18:00:00'
                    end_date: '2025-02-16'
                    end_time: '21:00:00'
                    local_formatted_time: 14 Feb 2025 at 18:00 – 16 Feb 2025 at 21:00 WET
                    title: Caldas Beer Fest
                    location_text: >-
                      Avenida Infante Dom Henrique 2, 2500-918 Caldas da Rainha,
                      Portugal
                    lat: 39.41153
                    lng: -9.14397
                    details: >
                      É com entusiasmo que anunciamos a 2ª edição do “Caldas
                      Beer Fest”, o Festival de Cerveja Artesanal, um evento
                      dedicado à celebração da rica tradição cervejeira na
                      região Oeste de Portugal. 

                      A segunda edição está marcada para os dias 14, 15 e 16 de
                      fevereiro, o festival terá lugar no Pavilhão Multiusos da
                      Expoeste, nas Caldas da Rainha.

                      As entradas são gratuitas! 

                      O horário do evento é:

                      Dia 14 das 18h00 às 23h00

                      Dia 15 das 12h00 às 23h00 

                      Dia 16 das 12h00 às 21h00

                      #CaldasBeerFest
                    source: fb
                    tags: []
                    has_tickets: null
                    hosts:
                      - ExpoesteAIRO
                      - eventos.caldas.rainha
                    related_events:
                      - event_id: '1263772085863100'
                        url: https://www.facebook.com/events/1263772085863100/
                        title: Juramento a la Bandera
                      - event_id: '1086211187421557'
                        url: https://www.facebook.com/events/1086211187421557/
                        title: INNOVATORS SUMMIT 2026
                      - event_id: '1355311996670263'
                        url: https://www.facebook.com/events/1355311996670263/
                        title: Reconectando con mi adolescente
                    responded_count: 1981
                    cover_image_url: >-
                      https://scontent.fuio10-1.fna.fbcdn.net/v/t39.30808-6/485785150_1068424841987402_6680348813369463683_n.jpg?stp=dst-jpg_tt6&cstp=mx1600x1074&ctp=s1600x1074&_nc_cat=108&ccb=1-7&_nc_sid=75d36f&_nc_ohc=dBzZpGQrKKsQ7kNvwFzTwQF&_nc_oc=Adr_zPBKCoqtoE2lN-Ojbi3evzSVtEMArpAuERszbYw1dNJQW_aXo2TPeVnEIronLb0&_nc_zt=23&_nc_ht=scontent.fuio10-1.fna&_nc_gid=aqotfdKd6bUc2VgFm3ie6A&_nc_ss=7d289&oh=00_AQImDTU7peyPhmHh7zCBBMCYYal5zRFkHEw9fqFasNGsOA&oe=6AB82FB8
                    location_place: null
                    location_from_details:
                      name: >-
                        Avenida Infante D. Henrique, nr. 2, 2500-918 Caldas da
                        Rainha, Portugal
                      contextual_name: >-
                        Avenida Infante D. Henrique, nr. 2, 2500-918 Caldas da
                        Rainha, Portugal
                    is_canceled: false
                requestId: c7c58f5e-eb94-4a44-96f8-19b3a6d7acdd
          headers: {}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '402':
          $ref: '#/components/responses/402'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      deprecated: false
      security:
        - JWT Bearer: []
components:
  responses:
    '400':
      description: Bad Request
      content:
        application/json:
          schema:
            type: object
            example:
              code: 400
              data: null
              message: 'Missing required parameter: handle'
    '401':
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            example:
              code: 401
              data: null
              message: apiKey is null
    '402':
      description: Payment Required
      content:
        application/json:
          schema:
            type: object
            example:
              code: 402
              data: null
              message: apiKey quota is not enough
    '429':
      description: Too Many Requests
      content:
        application/json:
          schema:
            type: object
            example:
              code: 429
              data: null
              message: qps limit exceeded
    '500':
      description: Internal Server Error
      content:
        application/json:
          schema:
            type: object
            example:
              code: 500
              data: null
              message: Internal server error
  securitySchemes:
    JWT Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |-
        接口鉴权凭证。请在请求 Header 中传入 `Authorization: Bearer <YOUR_API_KEY>`。
        可在 [Dashboard](https://keyapi.ai/app/dashboard) 获取你的 API Key。

````