> ## 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.

# Get ad details by just 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">per request</span></span>
</div>

## Copy for 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">🤖 Why Code When AI Can Do It For You?</p>
    <p className="mt-1 text-sm text-gray-700 dark:text-gray-300">Stop writing code like it's 1970! Let AI do the heavy lifting - click the sparkles to copy a perfectly formatted prompt for ChatGPT, Claude, or your favorite AI assistant.</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(`I need to call the following KeyAPI endpoint. Please generate a complete and directly runnable Python example based on the API information provided below.

## API Information

Endpoint: GET https://api.keyapi.ai/v1/facebook/ads_details_id
Summary: Get ad details by just id

Required Headers:
- Authorization: Bearer <YOUR_API_KEY>

Parameters:
- ad_archive_id (Required): No description. Example: 903264342253003

## Code Requirements

- Use the Python \`requests\` library
- Provide a complete and directly runnable example
- Handle HTTP request errors, timeouts, and non-2xx responses
- Handle JSON parsing errors
- Prefer the Example values provided in the API information for sample parameters
- Keep the code simple and avoid unnecessary abstractions or complexity`)}
    >
      <span>✨</span>
      <span>Copy for AI</span>
    </button>
  </div>
</div>


## OpenAPI

````yaml /en/facebook.openapi.json get /v1/facebook/ads_details_id
openapi: 3.0.1
info:
  title: Facebook API English documentation
  description: >-
    The english reference documentation of the Facebook API includes the
    interface's purpose, parameter description, response status, and sample
    structure.
  version: 1.0.0
servers:
  - url: https://api.keyapi.ai
    description: Production-KeyAPI
security:
  - JWT Bearer: []
tags:
  - name: Pages
  - name: Prefiles
  - name: Groups
  - name: Posts and comments
  - name: Evebts
  - name: Ads Library
  - name: Search
  - name: Marketplace
  - name: Games
paths:
  /v1/facebook/ads_details_id:
    get:
      tags:
        - Ads Library
      summary: Get ad details by just id
      parameters:
        - name: ad_archive_id
          in: query
          description: ''
          required: true
          example: '903264342253003'
          schema:
            type: string
            example: '903264342253003'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
              example:
                code: 0
                message: success
                data:
                  details:
                    advertiser:
                      page:
                        about:
                          text: |-
                            😎Twój ulubiony sklep internetowy z okularami
                            Ty definiujesz swój wygląd!
                        is_delegate_page_with_linked_primary_profile: false
                        id: '339984905864224'
                      ad_library_page_info:
                        page_spend:
                          current_week: null
                          lifetime_by_disclaimer: []
                          weekly_by_disclaimer: []
                          is_political_page: false
                        page_info:
                          entity_type: PERSON_PROFILE
                          ig_followers: 17346
                          ig_username: firmoopoland
                          ig_verification: false
                          likes: 35566
                          page_alias: firmoo.poland
                          page_category: Sunglasses and eyewear shop
                          page_cover_photo: >-
                            https://scontent.fccu4-3.fna.fbcdn.net/v/t39.30808-6/782169234_122236006676343591_1433542590153843970_n.jpg?_nc_cat=103&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=957871&_nc_ohc=mtV_eUd-cR8Q7kNvwED_-Xp&_nc_oc=AdpogrARo2e5i39sSPH8s3ttaTfgAJmjKWjZ0izEDcKC1N5pKNZYO7t6v0UQe77QUEs&_nc_zt=23&_nc_ht=scontent.fccu4-3.fna&_nc_gid=HtHUvqHMoeDyw2cBj7fWyg&_nc_ss=7d289&oh=00_AQIUHsF5xa0EDfgDSng5VDQl_8V3y1B-gdqY2_gTccT0dA&oe=6AB80441
                          page_id: '339984905864224'
                          page_is_deleted: false
                          page_is_restricted: false
                          page_name: Firmoo.poland
                          page_profile_uri: https://facebook.com/firmoo.poland
                          page_verification: NOT_VERIFIED
                          profile_photo: >-
                            https://scontent.fccu4-3.fna.fbcdn.net/v/t39.30808-1/447635128_440688882051771_5238228663214113656_n.jpg?stp=dst-jpg_s148x148_tt6&_nc_cat=103&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=418b77&_nc_ohc=tFLinc_z65YQ7kNvwFaTZ_h&_nc_oc=Adp98k-FI4wQLDmp6n5fbVAwkvlKguFtF8jin8WSj1-pkon6T_TA7OGMTfoV4g-O1E8&_nc_zt=24&_nc_ht=scontent.fccu4-3.fna&_nc_gid=HtHUvqHMoeDyw2cBj7fWyg&_nc_ss=7d289&oh=00_AQJq7yyvWmcgl24KWvX28YKqjbM4spSl12clapcJKv8-Dg&oe=6AB81CB5
                          is_profile_page: false
                    aaa_info:
                      payer_beneficiary_data:
                        - payer: >-
                            MeetSocial (HongKong)Digital Marketing Co.,
                            Limited16:06
                          beneficiary: Firmoo poland
                      targets_eu: true
                      has_violating_payer_beneficiary: false
                      is_ad_taken_down: false
                    violation_types: []
                    verified_voice_context: null
                    transparency_by_location:
                      br_transparency: null
                      eu_transparency:
                        targets_eu: true
                        location_audience:
                          - name: Poland
                            num_obfuscated: 0
                            type: countries
                            excluded: false
                        gender_audience: All
                        age_audience:
                          min: 18
                          max: 65
                        eu_total_reach: 4437106
                        age_country_gender_reach_breakdown:
                          - country: PL
                            age_gender_breakdowns:
                              - age_range: 18-24
                                male: 162273
                                female: 726079
                                unknown: 20939
                              - age_range: 45-54
                                male: 149808
                                female: 378998
                                unknown: 6839
                              - age_range: Unknown
                                male: 95
                                female: 692
                                unknown: 128
                              - age_range: 65+
                                male: 40460
                                female: 105295
                                unknown: 1565
                              - age_range: 55-64
                                male: 60306
                                female: 145577
                                unknown: 2266
                              - age_range: 35-44
                                male: 280084
                                female: 837549
                                unknown: 12276
                              - age_range: 25-34
                                male: 382706
                                female: 1250666
                                unknown: 22748
                      uk_transparency: null
                    is_siep_advertiser_eligible_for_ai_disclosure: true
                    is_violating_eu_siep: false
                requestId: f07a8e7c-6d55-4630-8da2-82295bab11af
          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: |-
        API key for authentication. Format: `sk_live_xxxxxxxxxxxxx`
        Get your API key from the [Dashboard](http://keyapi.ai/app/dashboard).

````