Title: YouTube API Request Error Fix
Last modified: April 25, 2022

---

# YouTube API Request Error Fix

 *  Resolved [enchamun](https://wordpress.org/support/users/enchamun/)
 * (@enchamun)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/youtube-api-request-error-fix/)
 * Hello,
 * some Server don’t send the correct HTTP Header to the Youtube API and you get
   a Request Error – also with correct Permission / Key / Domains etc.
 * After changing wp-youtube-lyte/wp-youtube-lyte.php:
 * Line 470: $yt_resp = wp_remote_get( $yt_api_url );
 * to:
 *  $yt_resp = wp_remote_get( $yt_api_url, array(
    ‘headers’ => array( ‘referer’
   => home_url() ) );
 * it runs without any Problems…
 * Greets
    Knut

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/youtube-api-request-error-fix/#post-15069157)
 * That’s a very interesting find Knut, would you care to do [a pull request against LYTE’s github repo](https://github.com/futtta/wp-youtube-lyte)?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/youtube-api-request-error-fix/#post-15085198)
 * I just added [@enchamun](https://wordpress.org/support/users/enchamun/)’s suggestion
   to the beta-version which you can download from [https://github.com/futtta/wp-youtube-lyte/archive/refs/heads/main.zip](https://github.com/futtta/wp-youtube-lyte/archive/refs/heads/main.zip),
   install instead of 1.7.17 and test 🙂
 *  Thread Starter [enchamun](https://wordpress.org/support/users/enchamun/)
 * (@enchamun)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/youtube-api-request-error-fix/#post-15087462)
 * After some test here another solution for the weird alphanumeric error. You need
   a alphanumeric key without underscore…. Therefore create a new YouTube API v3
   key, but NOT with the + Credentials Button. Go to Library add the YouTube API
   v3 again, the following generated key is “whooop!” alphanumeric.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/youtube-api-request-error-fix/#post-15087485)
 * Thanks for diving in the crazy world of YT API key management for us enchamun,
   much appreciated! 🙂
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/youtube-api-request-error-fix/#post-15106143)
 * OK, [I have a fix](https://github.com/futtta/wp-youtube-lyte/commit/702f8f217fcd2b87420ae9a7ebd555580ddef123)
   in the beta (github) version, can you download the beta from [https://github.com/futtta/wp-youtube-lyte/archive/refs/heads/main.zip](https://github.com/futtta/wp-youtube-lyte/archive/refs/heads/main.zip)
   and install that instead of 1.7.17 to test?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/youtube-api-request-error-fix/page/2/#post-15106178)
 * So it remains “checking key” but you see no further info? Can you re-try? And
   can you check the PHP-errorlog for relevant issues?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/youtube-api-request-error-fix/page/2/#post-15106291)
 * OK, I’ll push out an update later today, thanks for your help! 🙂
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/youtube-api-request-error-fix/page/2/#post-15106371)
 * 1.7.18 was just released 🙂
 * thanks everyone for helping out!

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘YouTube API Request Error Fix’ is closed to new replies.

 * ![](https://ps.w.org/wp-youtube-lyte/assets/icon-128x128.png?rev=1836005)
 * [WP YouTube Lyte](https://wordpress.org/plugins/wp-youtube-lyte/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-youtube-lyte/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-youtube-lyte/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-youtube-lyte/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-youtube-lyte/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-youtube-lyte/reviews/)

 * 8 replies
 * 4 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/youtube-api-request-error-fix/page/2/#post-15106371)
 * Status: resolved