API response as global variable
Load a REST API response on every page load and use it anywhere on the site as a variable.
A REST request with Source enabled can also get a Variable name. On every site load the request runs (using its cache) and the result is stored under that name. You can then read it in any text, attribute or condition, without binding a source to an element.
How it works
- Variable name: lowercase a-z, 0-9 and dots only, max 70 chars.
- Read it as $rest->get('<variable>').
- Runs with the request's default Properties and its cache setting.
When to use it
- Show a site-wide announcement from an API
- Load settings or exchange rates once and use them on many pages
Limitations
- Runs on every site load; without cache this adds the API latency to page loads
- Only GET-style usage makes sense; the request runs regardless of method
Availability
- Works in Designer.
- Included in every plan.
- Limits: Variable name 70 chars, a-z0-9 and dots
How to use it.
- Enable Source on the request
- Enter a Variable name
- Set a Cache duration
- Use the variable in the builder
Questions.
How do I reference it?
Related features.
Browse other features
Designer
Bring your ideas to life with our visual website builder. Drag and drop with ease, or dive into coding when needed.
→AI Studio
Describe it and AI builds it. Every change lands in the same project you can open in the Designer.
→MCP
Connect Claude Code, Cursor or any MCP client and build whole sites with your own agent.
→CMS
Create, organize, and manage your dynamic content with the maximum freedom and flexibility of our visual CMS.
→SEO
Divhunt delivers ultra-fast & structured sites that are good for ranking by default, while offering complete control for customization.
→REST API
Easily link to any REST API endpoint with instant preview and expand your site’s functionality smoother than ever before.
→Plugins
Divhunt offers an open platform for creating plugins to upgrade features, add new capabilities, and simplify building better sites.
→Localization
Localize everything from static pages and CMS content to URLs and metadata, in up to 15 languages with no add-on.
→Interactions
Visually create animations and interactions with a simple, intuitive timeline. Build smooth, engaging experiences without code.
→Custom Files
Manage JS and CSS files with a structure developers love, combining folders and clean organization.
→Memberships
Create plans, decide who sees what and connect it all to your CMS. Build courses, communities or client portals.
→