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

# Meta Scraping



## OpenAPI

````yaml POST /metascraping
openapi: 3.1.0
info:
  title: Geekflare
  description: Official OpenAPI specification for all Geekflare endpoints.
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://api.geekflare.com
security:
  - x-api-key: []
paths:
  /metascraping:
    post:
      tags:
        - api-tool
      summary: Scrape a webpage meta with custom options
      operationId: metaScrape
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MetaScrapeDto'
      responses:
        '200':
          description: Successfully scraped webpage meta
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetaScrapeResponseDto'
        '400':
          description: Invalid URL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseErrorResponseDto'
              example:
                timestamp: 1700000000000
                apiStatus: failure
                apiCode: 400
                message: INVALID_URL
                details: The URL must be a valid HTTP or HTTPS URL.
        '422':
          description: No metadata found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseErrorResponseDto'
              example:
                timestamp: 1700000000000
                apiStatus: failure
                apiCode: 422
                message: NO_METADATA
                details: Metadata could not be extracted from the target URL.
        '500':
          description: Crawling failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseErrorResponseDto'
              example:
                timestamp: 1700000000000
                apiStatus: failure
                apiCode: 500
                message: CRAWL_FAILED
                details: >-
                  Our crawling service encountered an error while attempting to
                  fetch data from the specified URL.
components:
  schemas:
    MetaScrapeDto:
      type: object
      properties:
        url:
          type: string
          description: Target URL
          example: https://example.com
        device:
          type: string
          description: Device type to emulate. Defaults to desktop.
          example: desktop
          enum:
            - desktop
            - mobile
          default: desktop
        blockAds:
          type: boolean
          description: Whether to block ads
          example: true
          default: true
        renderJS:
          type: boolean
          description: Whether to render JavaScript
          example: true
          default: true
        proxyCountry:
          type: string
          description: Proxy country code to route the request
          example: us
        format:
          type: string
          description: Format of the scraped result. Defaults to html.
          example: json
          enum:
            - markdown
            - json
          default: json
        fileOutput:
          type: boolean
          description: Whether to get response in file format
          example: false
          default: false
      required:
        - url
    MetaScrapeResponseDto:
      type: object
      properties:
        timestamp:
          type: number
          description: Timestamp of the request in milliseconds
          example: 1783063255117
        apiStatus:
          type: string
          description: API status message
          example: success
          enum:
            - success
            - failure
        apiCode:
          type: number
          description: API status code
          example: 200
        meta:
          description: Metadata about the request
          allOf:
            - $ref: '#/components/schemas/MetaScrapeMetaDto'
        data:
          description: Scraped data (URL or inline content depending on output)
          example: https://cdn.geekflare.com/tests/webscraping/ZuyhINuAZPQQabbN
          oneOf:
            - type: string
            - type: object
      required:
        - timestamp
        - apiStatus
        - apiCode
        - meta
        - data
    BaseErrorResponseDto:
      type: object
      properties:
        timestamp:
          type: number
          description: Timestamp of the request in milliseconds
          example: 1778737930991
        apiStatus:
          type: string
          description: API status message
          example: success
          enum:
            - success
            - failure
        apiCode:
          type: number
          description: API status code
          example: 200
        message:
          type: string
          description: Error message
          example: Invalid URL provided
        details:
          type: string
          description: Detailed error information
          example: The URL must be a valid HTTP or HTTPS URL
      required:
        - timestamp
        - apiStatus
        - apiCode
        - message
    MetaScrapeMetaDto:
      type: object
      properties:
        url:
          type: string
          description: The target URL that was scraped
          example: https://example.com
        device:
          type: string
          description: Device type used
          example: desktop
          enum:
            - desktop
            - mobile
        format:
          type: string
          description: Output format of the result
          example: json
          enum:
            - markdown
            - json
        fileOutput:
          type: boolean
          description: Whether to get response in file format
          example: false
        blockAds:
          type: boolean
          description: Whether ads were blocked
          example: true
        renderJS:
          type: boolean
          description: Whether JavaScript was rendered
          example: true
        proxyCountry:
          type: string
          description: Proxy country used, if any
        test:
          description: Test details object
          allOf:
            - $ref: '#/components/schemas/TestMetaDto'
      required:
        - url
        - device
        - format
        - fileOutput
        - blockAds
        - renderJS
        - test
    TestMetaDto:
      type: object
      properties:
        id:
          type: string
          description: Unique test identifier
          example: mxqx9v9y0742lap6altwdteqd28t23nq
      required:
        - id
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: API Key required for all endpoints

````