Skip to content
  • Why WPGetAPI?
  • Examples
  • Pricing
  • Plugins
    • PRO Plugin
    • API to Posts Plugin
    • OAuth 2.0 Plugin
  • Docs
  • Support
    • Frequently Asked Questions
    • Feature Request
    • Support Ticket
  • account_circle
PRO Plugin
Howdy! How can we help you?
  • Introduction

    • Quick Start
    • Frequently Asked Questions
    • Will this work with my API?
    • Understanding API docs
    • Step by Step Example
  • Setup

    • Setup Page
    • Endpoint Page
    • Parameters - Query String
    • Parameters - Headers
    • Parameters - Body POST
    • Shortcode
    • Template Tag
    • Gutenberg Block
  • Connecting your API

    • API Key in Headers
    • API Key in Query String
    • Authentication & Authorization
  • Output API Data

    • Format API to HTML
    • Format API to HTML Table
    • Format API to Image Gallery
    • Format JSON Data
  • Integrations

    • Send form data to API
    • WPForms to API
    • Gravity Forms to API
    • Contact Form 7 to API
    • WooCommerce to API
    • WooCommerce API Product Sync
    • wpDataTables to API
    • Connect WordPress to OpenAI
    • Connect RapidAPI to WordPress
    • Connect Zoho CRM to WordPress
    • Page Builders (Elementor, DIVI)
    • Formidable Forms to API
    • Elementor Form to API
    • JetFormBuilder to API
    • Fluent Forms to API
    • WS Form to API
    • Ninja Tables to API
    • Easy Digital Downloads(EDD) API Product Sync
    • Ultimate Member Forms to API
  • Tips & Tricks

    • Filters & Action Hooks
    • Code Snippets Plugin
    • Troubleshooting
    • Code Snippets
  • PRO Plugin

    • Installation
    • Actions
    • Tokens
    • Caching
    • Nested data
    • Chaining API calls
    • Dynamic Variables
    • Format API to HTML
    • Call API on user registration
    • Using AJAX to trigger API call
    • Base64 Encoding
    • Licensing
    • Filters & Action Hooks
  • OAuth 2.0 Plugin

    • Installation
    • How it works
    • Grant Type - Client Credentials
    • Grant Type - Authorization Code
    • Licensing
  • API to Posts Plugin

    • Installation
    • Getting Started
    • Multiple Endpoints
    • Mapping Fields
    • Filters & Action Hooks
    • Pagination
This feature is only available in the Pro Plugin.

Retrieving nested, or multidimensional data, can easily be achieved with the Pro Plugin.

The Pro Plugin allows you to step down through multidimensional array data using array keys and indexes to get your data. This works in both the template function and also the shortcode.

Our latest update to the PRO plugin now allows you to grab multiple array keys so that you can easily pick and choose which items from an array you want to display.

Let’s pretend that your API returned the data below. You could easily get the nickname of the first item, or you could get all nicknames, or you could get both the nickname and id of the second item. The possibilities are endless as to which data you can retrieve.

Array(
	[name] => Array(
		[0] => Array(
			[nickname] => Cowboy,
			[id] => 24538
		),
		[1] => Array(
			[nickname] => Yeehaa,
			[id] => 49890
		),
		[2] => Array(
			[nickname] => Horse,
			[id] => 14377
		)
	)
)

The shortcode and template functions to retrieve these various types of data would look something like this:

Get the id of index 1
[wpgetapi_endpoint api_id="my_api" endpoint_id="my_endpoint" keys="name,1,id"]
wpgetapi_endpoint( "my_api", "my_endpoint", array(), array( "name", 1, "id" ) );

Get the nickname of index 2
[wpgetapi_endpoint api_id="my_api" endpoint_id="my_endpoint" keys="name,2,nickname"]
wpgetapi_endpoint( "my_api", "my_endpoint", array(), array( "name", 2, "nickname" ) );

Get the nicknames of all items
For simplicity, we’ll just show what to add into the keys attribute.
Each item is wrapped in curly braces and we use the pipe symbol as the key seperator.
keys="{name|0|nickname},{name|1|nickname},{name|2|nickname}"
wpgetapi_endpoint( "my_api", "my_endpoint", array(), array( "{name|0|nickname}", "{name|1|nickname}", "{name|2|nickname}" ) );

Get all items
keys="name"
wpgetapi_endpoint( "my_api", "my_endpoint", array(), array( "name" ) );

Get all nickname and id of index 0
keys="name,0"
wpgetapi_endpoint( "my_api", "my_endpoint", array(), array( "name", 0 ) );

This can be combined with the format=”html” attribute to output your required data as HTML.

 

On this page

Unlock amazing features with the PRO Plugin

The PRO Plugin takes your API integrations to the next level.

  View Pro Plugin
contact_support

Still not sure?

APIs can be daunting and sometimes downright confusing.

But we are here to help! Our support is amazing and we can assist you with any setup required and ensure your API integrations are a success!

Ask Us Anything

Connect your WordPress website to external APIs without writing a single line of code. Send data from WordPress to your API or display data from your API within WordPress.

Support

  • Documentation
  • Support Ticket
  • Refund Policy
  • Contact Us
  • About Us
  • Affiliates

Articles

  • Quick Start Guide
  • WooCommerce Orders to API
  • WooCommerce API Products Sync
  • Contact Form 7 to API
  • WPForms to API
  • Gravity Forms to API
  • WordPress to RapidAPI

WordPress API Plugins

  • Free WPGetAPI Plugin
  • PRO Plugin
  • API to Posts Plugin Plugin
  • OAuth 2.0 Authorization Plugin

© 2025 WPGetAPI. All Rights Reserved.

"*" indicates required fields

Name*
This field is for validation purposes and should be left unchanged.