Introduction to Flourish Live API
Note: the Flourish API is an enterprise-level bolt-on and not available to all customers.
The Flourish API allows you to dynamically create and edit Flourish visualizations. Any visualization you can make via the app, you can also make via the API.
Given that any Flourish chart needs three components to be built: (1) template code, (2) data and (3) settings – the difference between the API and editor-built charts is that the API allows you to compose and manipulate these components entirely programmatically.
You can load in any template code with data and settings from any source, allowing for highly flexible chart builds.
Note that when you use the API, there is no persistent graphic in the editor that represents this visualization. It is a live visualization constructed from the template, the data and the settings.
With the Flourish API you can, for example:
- Connect a Flourish visualization to a database or live data feed
- Control Flourish visualizations based on inputs on your webpage
- Make a custom CMS plugin that can generate Flourish charts
- Create Flourish charts as part of R, Tableau, Jupyter or Observable notebooks
Flourish architecture
Follow the arrows and click on the various elements to learn more about the Flourish architecture!
Why use the API?
- Any data origin: connect a Flourish visualization to a database or live data feed or any other data source (not just from a CSV or via the editor)
- Easy multiple chart build: the API can make creating standardized visualizations a lot more efficient, by automating the build process
- Control settings across multiple charts: have control over what your charts look like and how they behave by easily managing base settings and styles across multiple charts. For example, you can change a color and this will be applied instantly to all charts.
- User can control every chart aspect: this includes user-facing controls that affect what happens to a chart, e.g. changing the type of chart ( = the template), data bindings, settings and the data
- Programmatic data manipulation: the site code can conditionally reshape or filter data (instead of building different data sets for different charts or using the Flourish row filter functionality)
- Data confidentiality: keep your data confidential by using the API in an internal network from an internal data source.
Find out how to get started or read how to make and update a visualization.
Frequently asked questions
- How does my data “connect” to the API?
The link to your data isn’t a part of the Flourish Live API. The API allows you to pull in data from any source – you can get the data into your website code by whatever means you like. Typically this is done with the fetch method or JavaScript libraries like axios or D3. - What data does the API need?
The API does not require a strict certain data source type. It’s all about how the data is loaded in, which changes when the data type changes. But in the end the data has to be in the right format / data structure for the template. It’s possible to reshape data in the API but ideally, the data should be delivered as close to the structure needed to reduce any performance hits. - How does refreshing the data work? How often will the data/chart be refreshed? If we refresh the data, does that immediately update the chart?
The chart would refresh whenever your site refreshes. It’s possible to build in functions in website code that would refresh the data whenever you want (e.g. interval of 5 minutes, 60 minutes, twice a day etc.)
Examples
Browse some of our examples below.