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

# Fetch an advertiser from the Meta Ad Library by Page ID

> Get an advertiser from the Meta Ad Library by its Facebook Page ID: the page and its linked Instagram account, its About text, how many ads it has, the organization Meta confirmed owns it, when it was created or renamed, where the people managing it are, and for advertisers of ads about social issues, elections or politics, their spend and targeting over the last 30 days. Costs 1 credit per request.



## OpenAPI

````yaml /openapi.json post /meta-ads/get-company
openapi: 3.1.0
info:
  title: Bridgly API
  description: >-
    Web scraping API for LinkedIn, X (Twitter), Reddit, GitHub, Instagram and
    TikTok. Authenticated endpoints accept a Bridgly API key (`bgly_…`) via
    `Authorization: Bearer <token>`.
  version: 1.0.0
servers:
  - url: https://api.bridgly.app
    description: Production
security: []
tags:
  - name: LinkedIn
    description: Scrape LinkedIn profiles, companies, posts, and search.
  - name: Reddit
    description: Scrape Reddit posts, subreddits, users, and search.
  - name: X (Twitter)
    description: Scrape tweets and search X.
  - name: GitHub
    description: >-
      Fetch GitHub profiles, pinned repos, contributions, repositories, stars,
      and projects via GitHub's GraphQL API.
  - name: Instagram
    description: Scrape Instagram profiles, posts, followers, and search.
  - name: TikTok
    description: Fetch TikTok profiles.
  - name: Meta Ads
    description: >-
      Search the Meta Ad Library: ads, ad details, and advertisers on Facebook
      and Instagram.
paths:
  /meta-ads/get-company:
    post:
      tags:
        - Meta Ads
      summary: Fetch an advertiser from the Meta Ad Library by Page ID
      description: >-
        Get an advertiser from the Meta Ad Library by its Facebook Page ID: the
        page and its linked Instagram account, its About text, how many ads it
        has, the organization Meta confirmed owns it, when it was created or
        renamed, where the people managing it are, and for advertisers of ads
        about social issues, elections or politics, their spend and targeting
        over the last 30 days. Costs 1 credit per request.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                pageId:
                  type: string
                  minLength: 1
                  description: >-
                    Facebook Page ID of the advertiser, e.g. "15087023444", as
                    returned in `page.id` or by the advertiser search. The Ad
                    Library link of the advertiser’s ads
                    (`?view_all_page_id=<id>`) works too.
                cacheMaxAgeHours:
                  description: >-
                    Accept a cached result scraped up to this many hours ago. A
                    cached result costs no credits, and its `cachedAt` says when
                    it was scraped. When no cached result is that recent, the
                    data is scraped live at the normal price. Leave it out to
                    always scrape live, e.g. 24.
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
                cacheOnly:
                  description: >-
                    Return only a cached result and never scrape live. With
                    `cacheMaxAgeHours`, only a result that recent is returned;
                    without it, the latest cached result of any age. Responds
                    404, at no cost, when there is none, e.g. true.
                  type: boolean
              required:
                - pageId
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  timeMs:
                    type: number
                    description: >-
                      Wall-clock time the request took to complete, in
                      milliseconds.
                  creditsCost:
                    type: number
                    description: Number of account credits this request consumed.
                  cachedAt:
                    anyOf:
                      - type: string
                        format: date-time
                        pattern: >-
                          ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                      - type: 'null'
                    description: >-
                      When the returned data was scraped, if it came from the
                      cache. Null when it was scraped live for this request.
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Facebook Page ID of the advertiser.
                      name:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: Name of the advertiser’s page.
                      username:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: Username of the page, e.g. "nike".
                      url:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: Link to the advertiser’s page.
                      profilePictureUrl:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: Profile picture of the page.
                      likes:
                        anyOf:
                          - type: number
                          - type: 'null'
                        description: Number of likes on the page.
                      category:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: Category of the page.
                      isVerified:
                        anyOf:
                          - type: boolean
                          - type: 'null'
                        description: Whether the page has a verified badge.
                      instagramUsername:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: Instagram account linked to the page.
                      instagramFollowers:
                        anyOf:
                          - type: number
                          - type: 'null'
                        description: Followers of the linked Instagram account.
                      instagramVerified:
                        anyOf:
                          - type: boolean
                          - type: 'null'
                        description: Whether the linked Instagram account is verified.
                      isDeleted:
                        anyOf:
                          - type: boolean
                          - type: 'null'
                        description: Whether the page has since been deleted.
                      about:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: About text of the page.
                      adCount:
                        anyOf:
                          - type: number
                          - type: 'null'
                        description: >-
                          Ads from this advertiser in the Ad Library, active and
                          inactive.
                      owner:
                        anyOf:
                          - type: object
                            properties:
                              name:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                                description: >-
                                  Legal name of the organization that owns the
                                  page.
                              phone:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                                description: Phone number of the organization.
                              city:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                                description: City of the organization.
                              state:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                                description: State or region.
                              postalCode:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                                description: Postal code.
                              country:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                                description: Country of the organization.
                            required:
                              - name
                              - phone
                              - city
                              - state
                              - postalCode
                              - country
                            additionalProperties: false
                          - type: 'null'
                        description: The organization Meta confirmed owns the page.
                      history:
                        type: array
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                              description: >-
                                What happened, e.g. "CREATION", "NAME_CHANGE" or
                                "MERGE".
                            date:
                              type: string
                              description: When it happened (ISO 8601).
                          required:
                            - type
                            - date
                          additionalProperties: false
                        description: When the page was created, renamed or merged.
                      adminCountries:
                        type: array
                        items:
                          type: object
                          properties:
                            country:
                              type: string
                              description: Country, e.g. "United States".
                            count:
                              type: number
                              description: Number of people managing the page from it.
                          required:
                            - country
                            - count
                          additionalProperties: false
                        description: Countries the people managing the page are in.
                      politicalAds:
                        anyOf:
                          - type: object
                            properties:
                              periodEnd:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                                description: Last day of the 30-day period (YYYY-MM-DD).
                              adCount:
                                anyOf:
                                  - type: number
                                  - type: 'null'
                                description: >-
                                  Ads about social issues, elections or politics
                                  in the last 30 days.
                              totalSpend:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                                description: >-
                                  Spend on those ads in the last 30 days, e.g.
                                  "$45,456".
                              currency:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                                description: Currency of `totalSpend`.
                              targeting:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    dimension:
                                      type: string
                                      description: >-
                                        What the row is about: "gender", "age",
                                        "location", "language",
                                        "customAudience", "lookalikeAudience" or
                                        "detailed".
                                    value:
                                      type: string
                                      description: >-
                                        The targeting option, e.g. "Women",
                                        "35", "Texas, United States".
                                    type:
                                      anyOf:
                                        - type: string
                                        - type: 'null'
                                      description: >-
                                        Kind of option, e.g. "regions" for a
                                        location or "INTERESTS" for detailed
                                        targeting.
                                    excluded:
                                      type: boolean
                                      description: >-
                                        Whether ads excluded this option rather
                                        than targeted it.
                                    adCount:
                                      type: number
                                      description: Ads that used this option.
                                    spendShare:
                                      anyOf:
                                        - type: number
                                        - type: 'null'
                                      description: >-
                                        Share of the spend on those ads, from 0
                                        to 1.
                                  required:
                                    - dimension
                                    - value
                                    - type
                                    - excluded
                                    - adCount
                                    - spendShare
                                  additionalProperties: false
                                description: >-
                                  How those ads were targeted. Only options used
                                  by at least one ad are listed.
                            required:
                              - periodEnd
                              - adCount
                              - totalSpend
                              - currency
                              - targeting
                            additionalProperties: false
                          - type: 'null'
                        description: >-
                          Spend and targeting of the advertiser’s ads about
                          social issues, elections or politics in the last 30
                          days, when it ran any.
                    required:
                      - id
                      - name
                      - username
                      - url
                      - profilePictureUrl
                      - likes
                      - category
                      - isVerified
                      - instagramUsername
                      - instagramFollowers
                      - instagramVerified
                      - isDeleted
                      - about
                      - adCount
                      - owner
                      - history
                      - adminCountries
                      - politicalAds
                    additionalProperties: false
                required:
                  - timeMs
                  - creditsCost
                  - cachedAt
                  - data
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
        '402':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
        '422':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: typescript
          label: Bridgly SDK
          source: |-
            import { Bridgly } from '@bridgly/sdk';

            const client = new Bridgly({ apiKey: process.env.BRIDGLY_API_KEY });

            const res = await client.metaAds.getCompany({
              pageId: "string",
            });
            if (res.type === 'success') console.log(res.data);
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A Bridgly API key (`bgly_…`). Metered endpoints deduct credits from the
        resolved account.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.