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

How to set debug to true

If you are having trouble getting your API to output data, the first step should be setting the ‘debug’ parameter to ‘true’. This will output a whole bunch of debugging information which can assist in finding the issue.

Using the Binance API as an example, we can see how to set debug to true on both the template tag and the shortcode.

Template tag

echo wpgetapi_endpoint( 'binance', 'price_of_coin', array('debug'='true') );

Shortcode

[wpgetapi_endpoint api_id='binance' endpoint_id='price_of_coin' debug='true']

Follow these links for help using the shortcode and help using the template tag.

A valid URL was not provided error

If you get the error shown below, it is usually because you have a space within your API ID or within your Endpoint ID in the settings of WPGetAPI.

These ID’s need to be lowercase with no spaces like this: “this_is_my_id” rather than “This Is My ID”

{"errors":{"http_request_failed":["A valid URL was not provided."]},"error_data":[]}

The template tag returns a Warning or says ‘Array’

If you are using the template tag and it outputs either of the following:

  • Array
  • Warning: Array to string conversion….

The likely cause is that you have tried to ‘echo’ the data when the Results Format is set to PHP array data, as shown below.

// wrong way to do it when set to PHP array data
echo wpgetapi_endpoint( 'binance', 'price_of_coin', array('debug'='false') );

// correct way to do it when set to PHP array data
// you can then use the $data variable however you like
$data = wpgetapi_endpoint( 'binance', 'price_of_coin', array('debug'='false') );

// wpgetapi_pp is a helper function for 'pretty printing' the raw data
wpgetapi_pp($data);

The other option is to simply set the Results Format to JSON string and echo the data but this may not return the desired results as it would return a JSON formatted string.

415 Unsupported Media Type error

This response code error indicates that the server refuses to accept the request because the payload format is in an unsupported format. This can usually be rectified by setting the ‘Content-Type’ to ‘application/json’ in the headers as shown below.

cURL error 28: Operation timed out after 10001 milliseconds

The cURL error 28 indicates that the server (where the API is hosted) is not responding within the default time of 10 seconds. This could be because the API server may be down or not responding, or the data that is being returned takes longer than 10 seconds to come back to you.

The default time can be increased by adding this snippet. The below snippet changes the timeout value to 30 seconds, but you can set this to whatever you like.

function wpgetapi_set_request_args_parameters( $args ) {
    $args['timeout'] = 30;
    return $args;
}
add_filter( 'wpgetapi_default_request_args_parameters', 'wpgetapi_set_request_args_parameters' );

If this error persists, there are some additional steps you can try. You can find more information here: https://www.wpbeginner.com/wp-tutorials/how-to-fix-curl-error-28-connection-timed-out-after-x-milliseconds/

On this page
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.