Skip to main content
Drupal is a registered trademark of Dries Buytaert
Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Usage Milestone: Menu Block Module menu_block crossed 1,000 active installs. Release: Thunder 8.4.2 Minor update available for distribution thunder (8.4.2). Release: DKAN Dataset Archiver 1.1.9 Minor update available for module dkan_dataset_archiver (1.1.9). Release: DKAN Dataset Archiver 0.333.9 Minor update available for module dkan_dataset_archiver (0.333.9). Release: DKAN Dataset Archiver 1.0.11 Minor update available for module dkan_dataset_archiver (1.0.11). Release: Copyright Footer 4.0.0-alpha2 New alpha version released for module copyright_footer (4.0.0-alpha2). Release: Views HTTP Client 1.0.0 Initial release available for module views_http_client (1.0.0)! Release: Copyright Footer 4.0.0-alpha1 First alpha version released for module copyright_footer (4.0.0-alpha1). Security Coverage: Entity Add Another Module entity_add_another now has official Drupal security advisory coverage.

Views HTTP Client

No security coverage Drupal 10–11 Views ecosystem
View on drupal.org

Views HTTP Client provides a native Views Query Plugin that allows you to build Views pages, blocks, and feeds by fetching data directly from external JSON HTTP/REST APIs instead of a local SQL database.

Unlike other solutions, it does not require creating local entities or writing custom code for simple integrations. You can point Views at any remote JSON endpoint, map nested properties to fields using dot notation, expose interactive filters, and paginate results using standard Views tools.

Features

  • Native Views Query Plugin: Fully replaces the SQL query engine with an HTTP/REST consumer.
  • Flexible Authentication & Key Integration:
    • None (Public APIs).
    • Basic Auth (Username / Password).
    • Bearer Token (supports Drupal token replacements).
    • API Key (delivered via custom HTTP Header or Query Parameter).
    • Integration with the Key module to securely manage API credentials without storing secrets in plain YAML configuration.
  • Dynamic URLs & Contextual Arguments: Full support for Drupal tokens (e.g. [site:name]) and Views contextual arguments ({{ raw_arguments.arg_0 }} or %1) in endpoint URLs, POST body payloads, and custom headers.
  • Advanced Pagination Modes:
    • Offset + Limit (?offset=N&limit=M).
    • Page Number (?page=N) with support for both 0-based and 1-based indexing.
    • Mapping to either total_items or total_pages in API responses.
  • Versatile Field Handler (HttpJsonField):
    • Dot-notation & Numeric Indexing: Read deeply nested values (e.g. author.address.city, items.0.title).
    • Lists & Arrays: Format arrays of values or objects (e.g. tags.*.name) joined with custom delimiters or rendered as HTML lists (<ul>, <ol>).
    • Images & Links: Custom classes, dynamic alt text extraction, lazy loading, and configurable link targets (_blank/_self).
    • Dates & Booleans: Integration with Drupal date formats and configurable True/False labels.
    • XSS Sanitization: Configurable security modes (HTML entity escape, administrative HTML filter, or raw markup with optional nl2br).
  • Rich Filter & Sort Plugins:
    • Generic API filter: Forwards text, date, or number parameters.
    • Date range filter: Dual date pickers (From / To) forwarded to independent API parameters.
    • Select dropdown filter: Dropdown filter with configurable key|value options.
    • Boolean filter: Forwards mapped True/False values.
    • Sort handler: Forwards sort column and direction (ASC/DESC).
  • High-Performance Caching:
    • Per-request static cache to avoid duplicate HTTP calls when rendering multiple blocks on the same page.
    • Persistent Drupal cache backend with configurable TTL (e.g. 5 min, 1 hour, 1 day) to survive API rate limits.
    • Dynamic cache tags and url.query_args cache contexts.
  • Developer Extensibility (Symfony Events):
    • PreRequestEvent: Inspect or alter URLs, headers, query params, or Guzzle options before execution.
    • PostResponseEvent: Intercept raw response payloads.
    • AlterRowsEvent: Filter, enrich, or restructure decoded items before Views creates ResultRow objects.
    • hook_views_http_client_fields(): Register strongly-typed field definitions in custom modules.

Post-Installation

  1. Navigate to Structure → Views → Add view (/admin/structure/views/add).
  2. Under View settings → Show, select "HTTP Client Endpoint".
  3. Click Save and edit.
  4. Open Advanced → Query settings:
    • Set the Endpoint URL (e.g. https://api.example.com/v1/articles?_format=json).
    • Set the Results path (dot-notation path to the items array, e.g. data.items or results). Leave empty if the JSON root is an array.
    • Configure Authentication, Pagination mode, and Total count paths.
  5. Add fields using "HTTP JSON field (generic)" and configure the property paths.
  6. Optionally add exposed filters or sort criteria.

Additional Requirements

  • PHP: ≥ 8.1
  • Drupal Core: ^10.3 || ^11
  • Core module: views
  • Key: Highly recommended to manage API tokens, basic auth passwords, and API keys securely without committing secrets to Git.

Similar projects

  • Views Remote Data: Focuses on an event-driven PHP approach where developers must write custom event subscribers for each data provider. Views HTTP Client provides a complete no-code UI query builder directly inside the Views interface while still offering Symfony events when customization is needed.
  • Views JSON Source: An older module that lacks modern Drupal 10/11 attribute discovery, Key module integration, advanced 0/1-based pagination, Symfony events, and list formatters.
  • External Entities: Useful when full entity mapping and CRUD operations are needed across the site. Views HTTP Client is significantly more lightweight for read-only listings, dashboards, and feeds.

Supporting this Module

Contributions, issue reports, and feature requests are welcome in the project issue queue!

Community Documentation

See the README.md included in the module for full technical documentation, hook implementations, and Symfony event subscriber examples.

Depends on

Dependencies of the latest stable release

  • views Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Aug 2026
Latest release
1 hour ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
1.0.0 Stable 10–11 Aug 31, 2026
1.0.0-beta1 Pre-release 10–11 Aug 31, 2026