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

Our plugins contain a number of actions and filters that help extend or modify the functionality of our plugins. Code snippets would need to be added to your themes functions.php file.

wpgetapi_final_request_args

Modifies the final arguments that are sent to the API.

function wpgetapi_modify_request_args( $args, $wpgetapi ) {
	$args['body']['something'] = 'something else';
	return $args;
}
add_filter( 'wpgetapi_final_request_args', 'wpgetapi_modify_request_args', 10, 2 );

wpgetapi_should_we_stop

Stops the API from being called until something happens.

function wpgetapi_stop( $stop, $wpgetapi ) {
	if( wait until something is true )
	    return true;
        return $stop;
}
add_filter( 'wpgetapi_should_we_stop', 'wpgetapi_stop', 10, 2 );

wpgetapi_before_retrieve_body

Modify the response before any type of formatting.

function wpgetapi_modify_response( $response, $response_code, $wpgetapi ) {
	if( $response_code == 401 )
	    return 'Sorry, you are not authorised.';
        return $response;
}
add_filter( 'wpgetapi_before_retrieve_body', 'wpgetapi_modify_response', 10, 3 );

wpgetapi_raw_data

Modify the response after any type of formatting.

function wpgetapi_modify_output( $data, $wpgetapi ) {
	if( ! $data )
	    return 'Sorry, no data returned.';
        return $data;
}
add_filter( 'wpgetapi_raw_data', 'wpgetapi_modify_output', 10, 2 );

wpgetapi_endpoint

Modify the endpoint before sending to the API.

function wpgetapi_modify_endpoint( $endpoint, $wpgetapi ) {
	$endpoint = $endpoint . '/extra_info';
        return $endpoint;
}
add_filter( 'wpgetapi_endpoint', 'wpgetapi_modify_endpoint', 10, 2 );

wpgetapi_query_parameters

Modify the query parameters before sending to the API.

function wpgetapi_modify_query_params( $params, $wpgetapi ) {
	$params['some_data'] = 'some value';
        return $params;
}
add_filter( 'wpgetapi_query_parameters', 'wpgetapi_modify_query_params', 10, 2 );

wpgetapi_header_parameters

Modify the header parameters before sending to the API.

function wpgetapi_modify_header_params( $params, $wpgetapi ) {
	$params['headers']['content-type'] = 'application/json';
        return $params;
}
add_filter( 'wpgetapi_header_parameters', 'wpgetapi_modify_header_params', 10, 2 );

wpgetapi_body_parameters

Modify the body parameters before sending to the API.

function wpgetapi_modify_body_params( $params, $wpgetapi ) {
	$params['user'] = '[email protected]';
        return $params;
}
add_filter( 'wpgetapi_body_parameters', 'wpgetapi_modify_body_params', 10, 2 );

wpgetapi_default_request_args_parameters

This filter will modify the default arguments for the API calls such as timeout, sslverify, redirection and others. The full list of arguments can be found here – https://developer.wordpress.org/reference/classes/wp_http/request/

The filter can be used like below.

function wpgetapi_modify_arguments( $args ) {
	$args['timeout'] = 30;
	$args['sslverify'] = true;
	return $args;
}
add_filter( 'wpgetapi_default_request_args_parameters', 'wpgetapi_modify_arguments', 10, 1 );

wpgetapi_final_url

This filter will modify the final URL that the API is calling.

function wpgetapi_modify_url( $url, $wpgetapi ) {
	$url = $url . '?add=something';
	return $url;
}
add_filter( 'wpgetapi_final_url', 'wpgetapi_modify_url', 10, 2 );

wpgetapi_before_retrieve_body

This filter can modify the response from the API as soon as we receive it.

function wpgetapi_modify_response( $response, $response_code, $wpgetapi ) {
	$response = 'blah blah blah';
	return $response;
}
add_filter( 'wpgetapi_before_retrieve_body', 'wpgetapi_modify_response', 10, 3 );
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.