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

# Estimate Google Ads cost per click

> <Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Estimates what one click costs for a landing page in a set of locations, so you can turn a daily budget into a click range before a campaign exists.

Google publishes no click forecast for a Performance Max campaign before it launches, so this answers a narrower question. Base44 asks Google's keyword planner for the keyword ideas it derives from `landing_page`, averages the top-of-page bid range over up to 10 of them, and takes 60% of that range, because a click usually costs less than the top-of-page bid. Divide a daily budget by `cpc_high_micros` and `cpc_low_micros` for the click range. Both are in the account's budget currency, so no conversion is needed. To forecast a Smart campaign from its keyword themes instead, use [Estimate a Google Ads campaign budget](/api-reference/estimate-a-google-ads-campaign-budget).

A `sample_size` of `0`, with both figures `0`, means Google had no keyword ideas it could price. Treat that as no estimate, not as free clicks.

The app needs a connected Google Ads account that has finished provisioning. An account with no Google customer ID yet, and a `landing_page` that is not an `http` or `https` URL, are rejected with a 400 before anything reaches Google. Nothing is saved and nothing is spent on ads.

This is limited to 30 requests a minute per app. Some workspaces have a different limit. It is refused with a 409 while the workspace is on a Google Ads billing hold.

<Note>This endpoint accepts a personal API key from anyone who can edit the app, or a workspace API key, which acts as the workspace owner. Read-only tokens and keys are refused with a 403.</Note>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json post /api/apps/{app_id}/google-ads/campaigns/cpc-estimate
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - PersonalAccessTokenAuth: []
paths:
  /api/apps/{app_id}/google-ads/campaigns/cpc-estimate:
    post:
      summary: Estimate Google Ads cost per click
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Estimates what one click costs for a landing page in a set of locations,
        so you can turn a daily budget into a click range before a campaign
        exists.


        Google publishes no click forecast for a Performance Max campaign before
        it launches, so this answers a narrower question. Base44 asks Google's
        keyword planner for the keyword ideas it derives from `landing_page`,
        averages the top-of-page bid range over up to 10 of them, and takes 60%
        of that range, because a click usually costs less than the top-of-page
        bid. Divide a daily budget by `cpc_high_micros` and `cpc_low_micros` for
        the click range. Both are in the account's budget currency, so no
        conversion is needed. To forecast a Smart campaign from its keyword
        themes instead, use [Estimate a Google Ads campaign
        budget](/api-reference/estimate-a-google-ads-campaign-budget).


        A `sample_size` of `0`, with both figures `0`, means Google had no
        keyword ideas it could price. Treat that as no estimate, not as free
        clicks.


        The app needs a connected Google Ads account that has finished
        provisioning. An account with no Google customer ID yet, and a
        `landing_page` that is not an `http` or `https` URL, are rejected with a
        400 before anything reaches Google. Nothing is saved and nothing is
        spent on ads.


        This is limited to 30 requests a minute per app. Some workspaces have a
        different limit. It is refused with a 409 while the workspace is on a
        Google Ads billing hold.


        <Note>This endpoint accepts a personal API key from anyone who can edit
        the app, or a workspace API key, which acts as the workspace owner.
        Read-only tokens and keys are refused with a 403.</Note>
      operationId: >-
        estimate_campaign_cpc_api_apps__app_id__google_ads_campaigns_cpc_estimate_post
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the app you are planning a Google Ads campaign for.
            title: App Id
          description: ID of the app you are planning a Google Ads campaign for.
          example: 6820f3a4e7b91d003c45a1f2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CpcEstimateRequest'
      responses:
        '200':
          description: The estimated cost of one click.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleAdsCpcEstimate'
        '400':
          description: >-
            `landing_page` is not an `http` or `https` URL, the account has not
            finished provisioning, or Google Ads rejected the request.
        '401':
          description: Missing or invalid credentials.
        '403':
          description: >-
            You can't edit this app, the app does not exist, or your token or
            key is read-only. A missing app and an app you cannot reach are
            deliberately the same answer.
        '404':
          description: The app has no connected Google Ads account.
        '409':
          description: The workspace is on a Google Ads billing hold.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: >-
            The app has used up its 30 estimates for the current minute, or
            Google Ads is rate limiting the account. Retry later.
        '503':
          description: >-
            Database temporarily unavailable (`database_unavailable`): the data
            cluster did not answer in time. Retry after the `Retry-After`
            seconds.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
              examples:
                database_unavailable:
                  summary: database_unavailable
                  value:
                    error:
                      code: database_unavailable
                      message: Database temporarily unavailable, please retry
                      details: {}
      security:
        - PersonalAccessTokenAuth:
            - full_access
        - WorkspaceApiKeyAuth:
            - full_access
        - WorkspaceApiKeyBearerAuth:
            - full_access
components:
  schemas:
    CpcEstimateRequest:
      properties:
        landing_page:
          type: string
          title: Landing Page
          description: >-
            Page the campaign sends clicks to, as an `http` or `https` URL.
            Google derives the keyword ideas it prices from this page. Required:
            anything else is rejected with a 400.
          default: ''
          example: https://example.com/furniture
        geo_targets:
          items:
            type: string
          type: array
          title: Geo Targets
          description: >-
            Locations to price clicks in, as Google geo target constant IDs
            (`geoTargetConstants/1023191`, or just `1023191`). When you send
            more than 10, only 10 of them are priced, always the same 10 for the
            same set. Leave it empty to price all locations. If Google's keyword
            planner rejects the locations you send, the estimate covers all
            locations instead of failing.
          example:
            - '1023191'
        language_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Language Code
          description: >-
            Two-letter code of the language the ads run in, which picks the
            keyword market. A regional tag like `pt-BR` is reduced to `pt`, and
            a missing or unsupported code prices in English. [List Google Ads
            advertising
            languages](/api-reference/list-google-ads-advertising-languages)
            returns the supported codes.
          example: en
      type: object
      title: CpcEstimateRequest
    GoogleAdsCpcEstimate:
      properties:
        cpc_low_micros:
          type: integer
          title: Cpc Low Micros
          description: >-
            Low end of the estimated cost of one click, in micros of
            `currency_code`, so `850000` is 0.85. `0` when there is no estimate.
          example: 850000
        cpc_high_micros:
          type: integer
          title: Cpc High Micros
          description: >-
            High end of the estimated cost of one click, in micros of
            `currency_code`. `0` when there is no estimate.
          example: 2400000
        currency_code:
          type: string
          title: Currency Code
          description: >-
            Currency of both figures as a three-letter ISO 4217 code. It is the
            account's Google Ads budget currency, the same one campaign budgets
            are set in.
          example: USD
        sample_size:
          type: integer
          title: Sample Size
          description: >-
            How many of Google's keyword ideas the range is averaged over, at
            most 10. `0` means Google returned none it could price, so there is
            no estimate.
          example: 10
      type: object
      required:
        - cpc_low_micros
        - cpc_high_micros
        - currency_code
        - sample_size
      title: GoogleAdsCpcEstimate
      description: What a click is likely to cost for a landing page in a set of locations.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    StandardErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/StandardError'
          description: What went wrong.
      type: object
      required:
        - error
      title: StandardErrorEnvelope
      description: The error body returned in the standard envelope.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    StandardError:
      properties:
        code:
          type: string
          title: Code
          description: >-
            Stable machine-readable cause of the failure. Match on this, not on
            `message`.
          example: not_found
        message:
          type: string
          title: Message
          description: Human-readable explanation. It isn't a stable contract.
          example: App not found
        details:
          additionalProperties: true
          type: object
          title: Details
          description: >-
            Structured context for the failure, or an empty object when there's
            none.
          example: {}
      type: object
      required:
        - code
        - message
      title: StandardError
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: >-
        Personal access token, sent as `Authorization: Bearer <token>`. Each
        operation lists the permission it needs: `read_only` or `full_access`. A
        full-access token can call every operation. A read-only token can call
        only the operations that list `read_only`; anything else returns 403
        `read_only_credential_route_not_allowed`.
    WorkspaceApiKeyAuth:
      type: apiKey
      in: header
      name: api_key
      description: >-
        Workspace API key, sent as `api_key: <key>`. Each operation that accepts
        one lists what the key needs: a permission, `read_only` or
        `full_access`, like a personal access token, or a scope. A key without
        the scope gets 403 `workspace_api_key_scope_required`.
    WorkspaceApiKeyBearerAuth:
      type: http
      scheme: bearer
      description: >-
        Workspace API key, sent as `Authorization: Bearer <key>`. Accepted
        wherever `api_key` is, with the same permission.

````

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