Title: youtube-api-interface.php
Last modified: March 13, 2018

---

# youtube-api-interface.php

 *  Resolved [awsss](https://wordpress.org/support/users/awsss/)
 * (@awsss)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/youtube-api-interface-php/)
 * Hi Sir, I have a question about the youtube-api-interface.php file I’m trying
   to put the maxres size and the result in media_url is null only can get “default,
   high” so could you help me how I set it on highest quality.
    best regards

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

 *  Plugin Author [enguerranws](https://wordpress.org/support/users/enguerranws/)
 * (@enguerranws)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/youtube-api-interface-php/#post-10078368)
 * Hi [@awsss](https://wordpress.org/support/users/awsss/),
 * You can do it editing youtube-api-interface.php, replacing each occurence of:
 * `$newResult['thumb_url'] = $searchResult['snippet']['thumbnails']['high']['url'];`
 * by:
 * `$newResult['thumb_url'] = $searchResult['snippet']['thumbnails']['maxres']['
   url'];`
 * But note that Youtube API v3 reference describes `maxres` format as “available
   for some videos”. What I understand here is that this resolution isn’t available
   for all videos, that’s why I set it to high.
 *  Thread Starter [awsss](https://wordpress.org/support/users/awsss/)
 * (@awsss)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/youtube-api-interface-php/#post-10079908)
 * Hi Thanks for answering, I’ve tried same to edit and the result is null in media_url
   post field
 *     ```
       $newResult['thumb_url'] = $searchResult['snippet']['thumbnails']['maxres']['url'];
       ```
   
 * when the thumbnail is maxres then nothing coming only works when its default 
   or high then it’s max 640 whatever if video HD or not so when video in HD the
   maxres can import 1200 and more.
 *  Plugin Author [enguerranws](https://wordpress.org/support/users/enguerranws/)
 * (@enguerranws)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/youtube-api-interface-php/#post-10153856)
 * Hi [@awsss](https://wordpress.org/support/users/awsss/),
 * again, `maxres` doesn’t seem to be available for all videos. That’s why it’s 
   returning as `null` sometimes.
 * You can simply perform a check: if `$searchResult['snippet']['thumbnails']['maxres']['
   url'];`is `null`, then pick `$searchResult['snippet']['thumbnails']['high']['
   url'];`.
 * However, that’s not an issue related to the plugin, but it’s mostly related to
   the Youtube API v3.

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

The topic ‘youtube-api-interface.php’ is closed to new replies.

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

 * 3 replies
 * 2 participants
 * Last reply from: [enguerranws](https://wordpress.org/support/users/enguerranws/)
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/youtube-api-interface-php/#post-10153856)
 * Status: resolved