I would break this problem in to 2 parts.
First, you could sent an Ajax request to your server, sending only the dataString
variable.
Then, you can use either cURL
or wp_remote_get()
on the server to access the real API.
This could be the only solution, if you want to avoid playing hide and seek with hashes and writing tons of code just to make it hard for the users to find the API key.
Related Posts:
- wp_remote_get() to get AJAX url /wp-admin/admin-ajax.php
- Is there a JavaScript API? How to access public and private data in JS?
- Ajax form submission from admin panel
- AJAX request from Chrome Extension to WordPress Website
- How to securely add an Ajax button to a WP Admin page?
- fetching via fetch/ajax gutenberg block data from third party
- AJAX requests broken due to HTTPS for wp-admin
- wp-admin AJAX with Fetch API is done without user
- wp_localize_script escaping my url – fix or alternative
- Most performant way of fetching remote API data?
- How to add WP API and JS featured image attachment
- Implementing an AJAX POST API call in wordpress
- I have to post data by AJAX in wordpress to another Website
- WP Admin AJAX Security – using POST to include a relative URL
- WordPress Ajax Not Working ( Custom Admin page)
- Why a strange discrepency between get_current_user_id() when using AJAX versus output of document.cookie?
- Pass additional parameter with async upload
- Exposing data using a custom WordPress API
- Preprocess submitted data
- How can I call an api before user login
- How to check nonce lifetime value of plugins?
- Use AJAX in a WordPress Plugin to Get Data From Custom Database?
- admin-ajax.php returns 0 even when the post status code is 200 OK
- Can I use application/json content type in WordPress
- wordpress admin ajax trash_comment
- Ajax call not working anymore
- WorddPress website admin part not working correctly – I think ajax/json issue
- How modify comments metabox on post edit screen in WordPress?
- Weird admin-ajax.php problem
- WordPress Get Header and Footer using in Admin Area
- get_comments() returns empty array if called through AJAX
- WordPress blocking polling request when signed into Admin
- randomly get 400 error while user is logged in wp_ajax
- How to submit a button automatically after every scheduled hours?
- Blocking admin-ajax.php from outside domain
- wp-admin/admin-ajax.php 400 Bad request (chrome console)
- wp_remote_post to admin-ajax.php isn’t sending body value
- contact form 7 form not working in admin panel
- How does the security of admin_ajax.php work?
- Posting to loop.php file
- ajax page template
- using Ajax: call to undefined function get_option
- apply_filters, EMBEDS and AJAX not a friends? [duplicate]
- Ajax Slideshow in Post
- register_setting and AJAX?
- modify buddpress adminbar only in admin pages
- How to get parent comment’s id?
- WordPress sound bell when new data will add
- WordPress Pagination with ajax – Dots
- Bad Request when adding new post via ajax form
- Static var overwritten with WP AJAX action, works fine without AJAX
- AJAX admin Internal 500 error Failed to Upload
- Using Javascript Callback from plugin in a theme
- Class property not visible inside ajax callback function?
- WordPress ajax requst returns zero
- Passing form data via AJAX to REST API And displaying results
- wp_editor() in content that was loaded with ajax [duplicate]
- Disable Ajax for Spiders
- ajax response is 0 instead of ‘script’ [duplicate]
- Can’t access data from database using AJAX
- WordPress & Ajax
- Why does my Ajax Get request give a 400 bad request?
- what’s the way to access variables from serializeArray
- using ajax to query sql
- WooCommerce AJAX cross domain add to cart
- How To Pass Ajax Value to PHP Query?
- Facebook Pixel + WooCommerce + AJAX = Confusion
- A refreshless WordPress website
- AJAX function needed (toggle text) [closed]
- Dynamic dependent select box getting null value
- An unidentified error has occurred when deleting a category
- Can a scrollable date picker be done in WordPress for archives?
- Ajax load more posts button
- Send button using own contact form [closed]
- wordpress ajax always return 0
- ajax for visitors wordpress
- Can admin-ajax.php be used for spam purposes? And if yes, how to prevent that?
- WordPress wp_localize_script nonce and ajax URL
- PHP cookie not set within AJAX call
- Call pre_get_posts inside ajax
- WordPress Ajax send response on every iteration of a loop
- get_template_part() does not render after the ajax request
- Translating wordpress foreach to ajax
- WordPress Ajax – looping data into a table
- $wpdb Ajax not redirecting to main page
- AJAX loading with custom parameters
- Front-end ajax problem all users and guests getting a 302 redirect when accessing wp-admin/admin-ajax.php
- Use Ajax to get an Options Settings Value
- how reduce fetch/XHR response time
- Running js in html code with same content
- cURL External API request displays content above other content on page
- How to get current_user_id from wordpress in node js?
- How to get data with Select AJAX PHP
- Adding custom fields to Wired Impact Volunteer Management Plugin
- wordpress ajax bad request 400
- Add “load more” functionality to an AJAX response
- how to update pagination after ajax call page 2 show 0
- Custom WP rest api endpoint only working on non https?
- how can i create get request unis ajax without expecting return value
- Placing ajax actions in different class