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_itemsortotal_pagesin API responses.
- Offset + Limit (
- 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
alttext 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).
- Dot-notation & Numeric Indexing: Read deeply nested values (e.g.
- 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_argscache 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 createsResultRowobjects.hook_views_http_client_fields(): Register strongly-typed field definitions in custom modules.
Post-Installation
- Navigate to Structure → Views → Add view (
/admin/structure/views/add). - Under View settings → Show, select "HTTP Client Endpoint".
- Click Save and edit.
- 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.itemsorresults). Leave empty if the JSON root is an array. - Configure Authentication, Pagination mode, and Total count paths.
- Set the Endpoint URL (e.g.
- Add fields using "HTTP JSON field (generic)" and configure the property paths.
- Optionally add exposed filters or sort criteria.
Additional Requirements
- PHP: ≥ 8.1
- Drupal Core: ^10.3 || ^11
- Core module:
views
Recommended modules/libraries
- 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
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 1.0.0 | Stable | 10–11 | Initial stable release for Drupal 10.3+ and Drupal 11. | Aug 31, 2026 | |
| 1.0.0-beta1 | Pre-release | 10–11 | Views Query plugin for external JSON HTTP/REST endpoints (Drupal 10.3+ & Drupal 11). | Aug 31, 2026 |