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

# Export advanced-filter results as CSV

> Streams the items matching the advanced filter criteria as a CSV file. When asynchronous CSV export is enabled on the deployment, returns `202 Accepted` with a `request_id` that can be polled via `/api/v2/csv-exports/{request_id}`; otherwise the CSV body is streamed inline.



## OpenAPI

````yaml /openapi-specs/pro-api-v11.yaml get /v2/advanced-filters/csv
openapi: 3.0.0
info:
  contact:
    email: info@blockscout.com
  title: Blockscout
  version: 11.0.3
servers:
  - url: http://localhost/api
    variables: {}
security: []
tags:
  - name: blocks
  - name: transactions
  - name: addresses
  - name: internal-transactions
  - name: tokens
  - name: token-transfers
  - name: smart-contracts
  - name: config
  - name: main-page
  - name: search
  - name: stats
  - name: csv-export
  - name: account-abstraction
  - name: withdrawals
  - name: advanced-filters
  - name: arbitrum
  - name: legacy
  - name: optimism
  - name: mud
  - name: celo
  - name: scroll
  - name: zilliqa
paths:
  /v2/advanced-filters/csv:
    get:
      tags:
        - advanced-filters
      summary: Export advanced-filter results as CSV
      description: >-
        Streams the items matching the advanced filter criteria as a CSV file.
        When asynchronous CSV export is enabled on the deployment, returns `202
        Accepted` with a `request_id` that can be polled via
        `/api/v2/csv-exports/{request_id}`; otherwise the CSV body is streamed
        inline.
      operationId: BlockScoutWeb.API.V2.AdvancedFilterController.list_csv
      parameters:
        - description: API key for rate limiting or for sensitive endpoints
          in: query
          name: apikey
          required: false
          schema:
            type: string
            x-struct: null
            x-validate: null
        - description: Secret key for getting access to restricted resources
          in: query
          name: key
          required: false
          schema:
            type: string
            x-struct: null
            x-validate: null
        - description: >-
            Comma-separated list of transaction types to include. Allowed
            values: `COIN_TRANSFER`, `CONTRACT_INTERACTION`,
            `CONTRACT_CREATION`, `ERC-20`, `ERC-404`, `ERC-721`, `ERC-1155`,
            `ERC-7984` (plus `ZRC-2` on Zilliqa). Values are matched
            case-insensitively; unknown entries are silently dropped.
          example: COIN_TRANSFER,ERC-20
          in: query
          name: transaction_types
          required: false
          schema:
            nullable: true
            type: string
            x-struct: null
            x-validate: null
        - description: >-
            Comma-separated list of 4-byte contract method selectors (lowercase,
            `0x`-prefixed). At most 20 unique entries are honored; invalid
            entries are dropped.
          example: 0xa9059cbb,0x095ea7b3
          in: query
          name: methods
          required: false
          schema:
            nullable: true
            type: string
            x-struct: null
            x-validate: null
        - description: Inclusive lower bound on `timestamp` (ISO 8601).
          example: '2024-01-01T00:00:00.000Z'
          in: query
          name: age_from
          required: false
          schema:
            nullable: true
            type: string
            x-struct: null
            x-validate: null
        - description: Inclusive upper bound on `timestamp` (ISO 8601).
          example: '2024-12-31T23:59:59.000Z'
          in: query
          name: age_to
          required: false
          schema:
            nullable: true
            type: string
            x-struct: null
            x-validate: null
        - description: Comma-separated list of sender address hashes to include.
          example: >-
            0x5a52e96bacdabb82fd05763e25335261b270efcb,0x00000000219ab540356cbb839cbe05303d7705fa
          in: query
          name: from_address_hashes_to_include
          required: false
          schema:
            nullable: true
            type: string
            x-struct: null
            x-validate: null
        - description: Comma-separated list of sender address hashes to exclude.
          example: >-
            0x5a52e96bacdabb82fd05763e25335261b270efcb,0x00000000219ab540356cbb839cbe05303d7705fa
          in: query
          name: from_address_hashes_to_exclude
          required: false
          schema:
            nullable: true
            type: string
            x-struct: null
            x-validate: null
        - description: Comma-separated list of recipient address hashes to include.
          example: >-
            0x5a52e96bacdabb82fd05763e25335261b270efcb,0x00000000219ab540356cbb839cbe05303d7705fa
          in: query
          name: to_address_hashes_to_include
          required: false
          schema:
            nullable: true
            type: string
            x-struct: null
            x-validate: null
        - description: Comma-separated list of recipient address hashes to exclude.
          example: >-
            0x5a52e96bacdabb82fd05763e25335261b270efcb,0x00000000219ab540356cbb839cbe05303d7705fa
          in: query
          name: to_address_hashes_to_exclude
          required: false
          schema:
            nullable: true
            type: string
            x-struct: null
            x-validate: null
        - description: >-
            How to combine the `from_address_hashes_*` and `to_address_hashes_*`
            filters. Accepts `or` or `and` (case-insensitive). `or` (default)
            matches an item if either side matches; `and` requires both sides to
            match. Any other value is silently coerced to `nil` (no relation
            constraint).
          example: and
          in: query
          name: address_relation
          required: false
          schema:
            nullable: true
            type: string
            x-struct: null
            x-validate: null
        - description: >-
            Inclusive lower bound on the item's transferred amount (decimal
            string in the token's base units).
          example: '0'
          in: query
          name: amount_from
          required: false
          schema:
            nullable: true
            type: string
            x-struct: null
            x-validate: null
        - description: >-
            Inclusive upper bound on the item's transferred amount (decimal
            string in the token's base units).
          example: '1000000'
          in: query
          name: amount_to
          required: false
          schema:
            nullable: true
            type: string
            x-struct: null
            x-validate: null
        - description: >-
            Comma-separated list of token contract address hashes to include.
            Use the literal `native` to also include native coin transfers. Each
            list (include and exclude) is capped to 20 entries separately.
          example: native,0xdac17f958d2ee523a2206206994597c13d831ec7
          in: query
          name: token_contract_address_hashes_to_include
          required: false
          schema:
            nullable: true
            type: string
            x-struct: null
            x-validate: null
        - description: >-
            Comma-separated list of token contract address hashes to exclude.
            Use the literal `native` to also exclude native coin transfers. Each
            list (include and exclude) is capped to 20 entries separately.
          example: '0x0000000000000000000000000000000000000000'
          in: query
          name: token_contract_address_hashes_to_exclude
          required: false
          schema:
            nullable: true
            type: string
            x-struct: null
            x-validate: null
        - description: 'Keyset cursor: block number of the last item from the previous page.'
          example: '23532302'
          in: query
          name: block_number
          required: false
          schema:
            pattern: ^([1-9][0-9]*|0)$
            type: string
            x-struct: null
            x-validate: null
        - description: >-
            Keyset cursor: transaction index within the block of the last item
            from the previous page.
          example: '1'
          in: query
          name: transaction_index
          required: false
          schema:
            pattern: ^([1-9][0-9]*|0)$
            type: string
            x-struct: null
            x-validate: null
        - description: >-
            Keyset cursor: internal-transaction index of the last item from the
            previous page. Use an empty string or the literal `null` when the
            previous item was not an internal transaction.
          in: query
          name: internal_transaction_index
          required: false
          schema:
            $ref: '#/components/schemas/IntegerStringOrEmptyOrNullLiteral'
        - description: >-
            Keyset cursor: token-transfer index of the last item from the
            previous page. Use an empty string or the literal `null` when the
            previous item was not a token transfer.
          in: query
          name: token_transfer_index
          required: false
          schema:
            $ref: '#/components/schemas/IntegerStringOrEmptyOrNullLiteral'
        - description: >-
            Keyset cursor: index within an ERC-1155 batch token transfer. Use an
            empty string or the literal `null` when the previous item was not
            part of a batch.
          in: query
          name: token_transfer_batch_index
          required: false
          schema:
            $ref: '#/components/schemas/IntegerStringOrEmptyOrNullLiteral'
      responses:
        '200':
          content:
            application/csv: {}
          description: CSV file (sync export).
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdvancedFilterCsvExportAccepted'
          description: >-
            Async export queued; poll `/api/v2/csv-exports/{request_id}` with
            the returned `request_id`.
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdvancedFilterCsvExportError'
          description: Too many pending export requests for this client.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdvancedFilterCsvExportError'
          description: Failed to create CSV export request.
      callbacks: {}
components:
  schemas:
    IntegerStringOrEmptyOrNullLiteral:
      oneOf:
        - pattern: ^([1-9][0-9]*|0)$
          type: string
          x-struct: null
          x-validate: null
        - enum:
            - ''
            - 'null'
          type: string
          x-struct: null
          x-validate: null
      title: IntegerStringOrEmptyOrNullLiteral
      x-struct: >-
        Elixir.BlockScoutWeb.Schemas.API.V2.General.IntegerStringOrEmptyOrNullLiteral
      x-validate: null
    AdvancedFilterCsvExportAccepted:
      additionalProperties: false
      description: >-
        Body returned when an asynchronous CSV export job has been queued. Poll
        `/api/v2/csv-exports/{request_id}` with the returned `request_id` to
        check status.
      properties:
        request_id:
          description: UUID of the queued export request.
          format: uuid
          nullable: false
          type: string
          x-struct: null
          x-validate: null
      required:
        - request_id
      title: AdvancedFilterCsvExportAccepted
      type: object
      x-struct: Elixir.BlockScoutWeb.Schemas.API.V2.AdvancedFilter.CsvExportAccepted
      x-validate: null
    AdvancedFilterCsvExportError:
      additionalProperties: false
      properties:
        error:
          description: Human-readable error description.
          nullable: false
          type: string
          x-struct: null
          x-validate: null
      required:
        - error
      title: AdvancedFilterCsvExportError
      type: object
      x-struct: Elixir.BlockScoutWeb.Schemas.API.V2.AdvancedFilter.CsvExportError
      x-validate: null
    JsonErrorResponse:
      properties:
        errors:
          items:
            properties:
              detail:
                example: null value where string expected
                type: string
                x-struct: null
                x-validate: null
              source:
                properties:
                  pointer:
                    example: /data/attributes/petName
                    type: string
                    x-struct: null
                    x-validate: null
                required:
                  - pointer
                type: object
                x-struct: null
                x-validate: null
              title:
                example: Invalid value
                type: string
                x-struct: null
                x-validate: null
            required:
              - title
              - source
              - detail
            type: object
            x-struct: null
            x-validate: null
          type: array
          x-struct: null
          x-validate: null
      required:
        - errors
      title: JsonErrorResponse
      type: object
      x-struct: Elixir.OpenApiSpex.JsonErrorResponse
      x-validate: null

````