## GDataYouTubeQuery GDataYouTubeQuery — GData YouTube query object |

## Stability Level

Stable, unless otherwise indicated

## Functions

GDataYouTubeQuery * | gdata_youtube_query_new ()
GDataYouTubeAge | gdata_youtube_query_get_age ()
void | gdata_youtube_query_set_age ()
GDataYouTubeFormat | gdata_youtube_query_get_format ()
void | gdata_youtube_query_set_format ()
const gchar * | gdata_youtube_query_get_language ()
void | gdata_youtube_query_set_language ()
const gchar * | gdata_youtube_query_get_license ()
void | gdata_youtube_query_set_license ()
void | gdata_youtube_query_get_location ()
void | gdata_youtube_query_set_location ()
const gchar * | gdata_youtube_query_get_order_by ()
void | gdata_youtube_query_set_order_by ()
const gchar * | gdata_youtube_query_get_restriction ()
void | gdata_youtube_query_set_restriction ()
GDataYouTubeSafeSearch | gdata_youtube_query_get_safe_search ()
void | gdata_youtube_query_set_safe_search ()
GDataYouTubeSortOrder | gdata_youtube_query_get_sort_order ()
void | gdata_youtube_query_set_sort_order ()
GDataYouTubeUploader | gdata_youtube_query_get_uploader ()
void | gdata_youtube_query_set_uploader ()

## Properties

GDataYouTubeAge | age | Read / Write
GDataYouTubeFormat | format | Read / Write
gboolean | has-location | Read / Write
char * | language | Read / Write
double | latitude | Read / Write
char * | license | Read / Write
double | location-radius | Read / Write
double | longitude | Read / Write
char * | order-by | Read / Write
char * | restriction | Read / Write
GDataYouTubeSafeSearch | safe-search | Read / Write
GDataYouTubeSortOrder | sort-order | Read / Write
GDataYouTubeUploader | uploader | Read / Write

## Types and Values

| GDataYouTubeQuery
| GDataYouTubeQueryClass
enum | GDataYouTubeAge
enum | GDataYouTubeFormat
enum | GDataYouTubeSafeSearch
enum | GDataYouTubeSortOrder
enum | GDataYouTubeUploader

## Object Hierarchy

        GEnum
        ├── GDataYouTubeAge
        ├── GDataYouTubeFormat
        ├── GDataYouTubeSafeSearch
        ├── GDataYouTubeSortOrder
        ╰── GDataYouTubeUploader
        GObject
        ╰── GDataQuery
            ╰── GDataYouTubeQuery

## Includes

    #include <gdata/services/youtube/gdata-youtube-query.h>

## Description

GDataYouTubeQuery represents a collection of query parameters specific to the YouTube service, which go above and beyond those catered for by GDataQuery.

With the transition to version 3 of the YouTube, the “author” and “start-index” properties are no longer supported, and their values will be ignored. Use `gdata_query_next_page()` instead of the “start-index” API.

For more information on the custom GData query parameters supported by GDataYouTubeQuery, see the online documentation.

## Functions

### gdata_youtube_query_new ()

    GDataYouTubeQuery *
    gdata_youtube_query_new (const gchar *q);

Creates a new GDataYouTubeQuery with its “q” property set to `q` .

#### Parameters

q | a query string, or `NULL`. | [allow-none]

#### Returns

a new GDataYouTubeQuery

Since: 0.3.0

### gdata_youtube_query_get_age ()

    GDataYouTubeAge
    gdata_youtube_query_get_age (GDataYouTubeQuery *self);

Gets the “age” property.

#### Parameters

self | a GDataYouTubeQuery |

#### Returns

the age property

Since: 0.3.0

### gdata_youtube_query_set_age ()

    void
    gdata_youtube_query_set_age (GDataYouTubeQuery *self,
                                 GDataYouTubeAge age);

Sets the “age” property of the GDataYouTubeQuery to `age` .

#### Parameters

self | a GDataYouTubeQuery |
age | the new age |

Since: 0.3.0

### gdata_youtube_query_get_format ()

    GDataYouTubeFormat
    gdata_youtube_query_get_format (GDataYouTubeQuery *self);

`gdata_youtube_query_get_format` has been deprecated since version 0.17.0 and should not be used in newly-written code.

No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

Gets the “format” property.

#### Parameters

self | a GDataYouTubeQuery |

#### Returns

the format property

Since: 0.3.0

### gdata_youtube_query_set_format ()

    void
    gdata_youtube_query_set_format (GDataYouTubeQuery *self,
                                    GDataYouTubeFormat format);

`gdata_youtube_query_set_format` has been deprecated since version 0.17.0 and should not be used in newly-written code.

No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

Sets the “format” property of the GDataYouTubeQuery to `format` .

#### Parameters

self | a GDataYouTubeQuery |
format | the requested video format |

Since: 0.3.0

### gdata_youtube_query_get_language ()

    const gchar *
    gdata_youtube_query_get_language (GDataYouTubeQuery *self);

`gdata_youtube_query_get_language` has been deprecated since version 0.17.0 and should not be used in newly-written code.

No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

Gets the “language” property.

#### Parameters

self | a GDataYouTubeQuery |

#### Returns

the language property, or `NULL` if it is unset

Since: 0.3.0

### gdata_youtube_query_set_language ()

    void
    gdata_youtube_query_set_language (GDataYouTubeQuery *self,
                                      const gchar *language);

`gdata_youtube_query_set_language` has been deprecated since version 0.17.0 and should not be used in newly-written code.

No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

Sets the “language” property of the GDataYouTubeQuery to the new language, `language` .

Set `language` to `NULL` to unset the property in the query URI.

#### Parameters

self | a GDataYouTubeQuery |
language | a new language name, or `NULL`. | [allow-none]

Since: 0.3.0

### gdata_youtube_query_get_license ()

    const gchar *
    gdata_youtube_query_get_license (GDataYouTubeQuery *self);

Gets the “license” property.

#### Parameters

self | a GDataYouTubeQuery |

#### Returns

the license property, or `NULL` if it is unset

Since: 0.11.0

### gdata_youtube_query_set_license ()

    void
    gdata_youtube_query_set_license (GDataYouTubeQuery *self,
                                     const gchar *license);

Sets the “license” property of the GDataYouTubeQuery to the new license value, `license` .

Set `license` to `NULL` to unset the property in the query URI.

#### Parameters

self | a GDataYouTubeQuery |
license | a new license value, or `NULL`. | [allow-none]

Since: 0.11.0

### gdata_youtube_query_get_location ()

    void
    gdata_youtube_query_get_location (GDataYouTubeQuery *self,
                                      gdouble *latitude,
                                      gdouble *longitude,
                                      gdouble *radius,
                                      gboolean *has_location);

Gets the location-based properties of the GDataYouTubeQuery: “latitude”, “longitude”, “location-radius” and “has-location”.

#### Parameters

self | a GDataYouTubeQuery |
latitude | a location in which to return the latitude, or `NULL`. | [out caller-allocates][allow-none]
longitude | a location in which to return the longitude, or `NULL`. | [out caller-allocates][allow-none]
radius | a location in which to return the location radius, or `NULL`. | [out caller-allocates][allow-none]
has_location | a location in which to return `TRUE` if the query is searching for videos with a specific location, `FALSE` otherwise, or `NULL`. | [out caller-allocates][allow-none]

Since: 0.3.0

### gdata_youtube_query_set_location ()

    void
    gdata_youtube_query_set_location (GDataYouTubeQuery *self,
                                      gdouble latitude,
                                      gdouble longitude,
                                      gdouble radius,
                                      gboolean has_location);

Sets the location-based properties of the GDataYouTubeQuery: “latitude”, “longitude”, “location-radius” and “has-location”.

#### Parameters

self | a GDataYouTubeQuery |
latitude | the new latitude, or `G_MAXDOUBLE` |
longitude | the new longitude, or `G_MAXDOUBLE` |
radius | the new location radius, or `0` |
has_location | `TRUE` if the query is for videos with a specific location, `FALSE` otherwise |

Since: 0.3.0

### gdata_youtube_query_get_order_by ()

    const gchar *
    gdata_youtube_query_get_order_by (GDataYouTubeQuery *self);

Gets the “order-by” property.

#### Parameters

self | a GDataYouTubeQuery |

#### Returns

the order by property, or `NULL` if it is unset

Since: 0.3.0

### gdata_youtube_query_set_order_by ()

    void
    gdata_youtube_query_set_order_by (GDataYouTubeQuery *self,
                                      const gchar *order_by);

Sets the “order-by” property of the GDataYouTubeQuery to the new order by string, `order_by` .

Set `order_by` to `NULL` to unset the property in the query URI.

#### Parameters

self | a GDataYouTubeQuery |
order_by | a new order by string, or `NULL`. | [allow-none]

Since: 0.3.0

### gdata_youtube_query_get_restriction ()

    const gchar *
    gdata_youtube_query_get_restriction (GDataYouTubeQuery *self);

Gets the “restriction” property.

#### Parameters

self | a GDataYouTubeQuery |

#### Returns

the restriction property, or `NULL` if it is unset

Since: 0.3.0

### gdata_youtube_query_set_restriction ()

    void
    gdata_youtube_query_set_restriction (GDataYouTubeQuery *self,
                                         const gchar *restriction);

Sets the “restriction” property of the GDataYouTubeQuery to the new restriction string, `restriction` .

Set `restriction` to `NULL` to unset the property in the query URI.

#### Parameters

self | a GDataYouTubeQuery |
restriction | a new restriction string, or `NULL`. | [allow-none]

Since: 0.3.0

### gdata_youtube_query_get_safe_search ()

    GDataYouTubeSafeSearch
    gdata_youtube_query_get_safe_search (GDataYouTubeQuery *self);

Gets the “safe-search” property.

#### Parameters

self | a GDataYouTubeQuery |

#### Returns

the safe search property

Since: 0.3.0

### gdata_youtube_query_set_safe_search ()

    void
    gdata_youtube_query_set_safe_search (GDataYouTubeQuery *self,
                                         GDataYouTubeSafeSearch safe_search);

Sets the “safe-search” property of the GDataYouTubeQuery to `safe_search` .

#### Parameters

self | a GDataYouTubeQuery |
safe_search | a new safe search level |

Since: 0.3.0

### gdata_youtube_query_get_sort_order ()

    GDataYouTubeSortOrder
    gdata_youtube_query_get_sort_order (GDataYouTubeQuery *self);

`gdata_youtube_query_get_sort_order` has been deprecated since version 0.17.0 and should not be used in newly-written code.

No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

Gets the “sort-order” property.

#### Parameters

self | a GDataYouTubeQuery |

#### Returns

the sort order property

Since: 0.3.0

### gdata_youtube_query_set_sort_order ()

    void
    gdata_youtube_query_set_sort_order (GDataYouTubeQuery *self,
                                        GDataYouTubeSortOrder sort_order);

`gdata_youtube_query_set_sort_order` has been deprecated since version 0.17.0 and should not be used in newly-written code.

No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

Sets the “sort-order” property of the GDataYouTubeQuery to `sort_order` .

Set `sort_order` to `GDATA_YOUTUBE_SORT_NONE` to unset the property in the query URI.

#### Parameters

self | a GDataYouTubeQuery |
sort_order | the new sort order |

Since: 0.3.0

### gdata_youtube_query_get_uploader ()

    GDataYouTubeUploader
    gdata_youtube_query_get_uploader (GDataYouTubeQuery *self);

`gdata_youtube_query_get_uploader` has been deprecated since version 0.17.0 and should not be used in newly-written code.

No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

Gets the “uploader” property.

#### Parameters

self | a GDataYouTubeQuery |

#### Returns

the uploader property

Since: 0.3.0

### gdata_youtube_query_set_uploader ()

    void
    gdata_youtube_query_set_uploader (GDataYouTubeQuery *self,
                                      GDataYouTubeUploader uploader);

`gdata_youtube_query_set_uploader` has been deprecated since version 0.17.0 and should not be used in newly-written code.

No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

Sets the “uploader” property of the GDataYouTubeQuery to `uploader` .

#### Parameters

self | a GDataYouTubeQuery |
uploader | the new uploader |

Since: 0.3.0

## Types and Values

### GDataYouTubeQuery

    typedef struct _GDataYouTubeQuery GDataYouTubeQuery;

All the fields in the GDataYouTubeQuery structure are private and should never be accessed directly.

Since: 0.3.0

### GDataYouTubeQueryClass

    typedef struct {
    } GDataYouTubeQueryClass;

All the fields in the GDataYouTubeQueryClass structure are private and should never be accessed directly.

Since: 0.3.0

### enum GDataYouTubeAge

Video ages, allowing queries to be limited to videos uploaded in a recent time period.

#### Members

GDATA_YOUTUBE_AGE_ALL_TIME | retrieve all videos, regardless of the date they were uploaded |
GDATA_YOUTUBE_AGE_TODAY | retrieve only videos uploaded in the past day |
GDATA_YOUTUBE_AGE_THIS_WEEK | retrieve only videos uploaded in the past week |
GDATA_YOUTUBE_AGE_THIS_MONTH | retrieve only videos uploaded in the past month |

Since: 0.3.0

### enum GDataYouTubeFormat

`GDataYouTubeFormat` has been deprecated since version 0.17.0 and should not be used in newly-written code.

Accessing YouTube video content directly is no longer supported by Google. There is no replacement.

Video formats available on YouTube. For more information, see the

online documentation.

#### Members

GDATA_YOUTUBE_FORMAT_UNKNOWN | retrieve videos in all formats when querying the service |
GDATA_YOUTUBE_FORMAT_RTSP_H263_AMR | RTSP streaming URI for mobile video playback; H.263 video (up to 176×144) and AMR audio |
GDATA_YOUTUBE_FORMAT_HTTP_SWF | HTTP URI to the embeddable player (SWF) for this video |
GDATA_YOUTUBE_FORMAT_RTSP_MPEG4_AAC | RTSP streaming URI for mobile video playback; MPEG-4 SP video (up to 176×144) and AAC audio |

Since: 0.3.0

### enum GDataYouTubeSafeSearch

Safe search levels for removing restricted entries from query results. For more information, see the

online documentation.

#### Members

GDATA_YOUTUBE_SAFE_SEARCH_NONE | YouTube will not perform any filtering on the search result set |
GDATA_YOUTUBE_SAFE_SEARCH_MODERATE | YouTube will filter some content from search results and, at the least, will filter content that is restricted in your locale |
GDATA_YOUTUBE_SAFE_SEARCH_STRICT | YouTube will try to exclude all restricted content from the search result set |

Since: 0.3.0

### enum GDataYouTubeSortOrder

`GDataYouTubeSortOrder` has been deprecated since version 0.17.0 and should not be used in newly-written code.

No longer supported by Google. There is no replacement.

Sort orders for the search results from queries. They specify the order of the designated order field.

#### Members

GDATA_YOUTUBE_SORT_NONE | do not explicitly sort in any sense |
GDATA_YOUTUBE_SORT_ASCENDING | sort results in ascending order of the order field |
GDATA_YOUTUBE_SORT_DESCENDING | sort results in descending order of the order field |

Since: 0.3.0

### enum GDataYouTubeUploader

`GDataYouTubeUploader` has been deprecated since version 0.17.0 and should not be used in newly-written code.

No longer supported by Google. There is no replacement.

Video uploaders, allowing queries to be limited to returning videos uploaded by YouTube partners.

#### Members

GDATA_YOUTUBE_UPLOADER_ALL | retrieve all videos, regardless of who uploaded them |
GDATA_YOUTUBE_UPLOADER_PARTNER | retrieve only videos uploaded by YouTube partners |

Since: 0.3.0

## Property Details

### The `“age”` property

      “age”                      GDataYouTubeAge

Restricts the search to videos uploaded within the specified time period. To retrieve videos irrespective of their age, set the property to `GDATA_YOUTUBE_AGE_ALL_TIME`.

Owner: GDataYouTubeQuery

Flags: Read / Write

Default value: GDATA_YOUTUBE_AGE_ALL_TIME

Since: 0.3.0

### The `“format”` property

      “format”                   GDataYouTubeFormat

Specifies that videos must be available in a particular video format. Use `GDATA_YOUTUBE_FORMAT_UNKNOWN` to retrieve videos irrespective of their format availability.

`GDataYouTubeQuery:format` has been deprecated since version 0.17.0 and should not be used in newly-written code.

No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

Owner: GDataYouTubeQuery

Flags: Read / Write

Default value: GDATA_YOUTUBE_FORMAT_UNKNOWN

Since: 0.3.0

### The `“has-location”` property

      “has-location”             gboolean

Whether to restrict search results to videos with specific coordinates associated with them. If used with a given “latitude” and “longitude”, only videos with specific coordinates (not those with merely a descriptive address) will be returned. If used without a latitude and longitude set, only videos with specific coordinates (regardless of those coordinates) will be returned.

For more information, see the documentation for “latitude”.

`GDataYouTubeQuery:has-location` has been deprecated since version 0.17.0 and should not be used in newly-written code.

No longer supported by Google. The value of this property will be unused in queries.

Owner: GDataYouTubeQuery

Flags: Read / Write

Default value: FALSE

Since: 0.3.0

### The `“language”` property

      “language”                 char *

Restricts the search to videos that have a title, description or keywords in a specified language. The language code should be a two-letter ISO 639-1 code; or you can use `zh-Hans` for simplified Chinese and `zh-Hant` for traditional Chinese.

For more information, see the online documentation.

`GDataYouTubeQuery:language` has been deprecated since version 0.17.0 and should not be used in newly-written code.

No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

Owner: GDataYouTubeQuery

Flags: Read / Write

Default value: NULL

Since: 0.3.0

### The `“latitude”` property

      “latitude”                 double

The latitude of a particular location of which videos should be found. This should be used in conjunction with “longitude”; if either property is outside the valid range, neither will be used. Valid latitudes are between `-90` and `90`0 degrees; any values of this property outside that range will unset the property in the query URI.

If “location-radius” is a non-`0` value, this will define a circle from which videos should be found.

As it is deprecated, the value of “has-location” is ignored.

For more information, see the online documentation.

Owner: GDataYouTubeQuery

Flags: Read / Write

Default value: 1.79769e+308

Since: 0.3.0

### The `“license”` property

      “license”                  char *

The content license which should be used to filter search results. If set to, for example, `GDATA_YOUTUBE_LICENSE_CC`, only videos which are Creative Commons licensed will be returned in search results. Set this to `NULL` to return videos under any license.

For more information, see the online documentation.

Owner: GDataYouTubeQuery

Flags: Read / Write

Default value: NULL

Since: 0.11.0

### The `“location-radius”` property

      “location-radius”          double

The radius, in metres, of a circle from within which videos should be returned. The circle is centred on the latitude and longitude given in “latitude” and “longitude”.

Set this property to `0` to search for specific coordinates, rather than within a given radius.

For more information, see the documentation for “latitude”.

Owner: GDataYouTubeQuery

Flags: Read / Write

Allowed values: >= 0

Default value: 0

Since: 0.3.0

### The `“longitude”` property

      “longitude”                double

The longitude of a particular location of which videos should be found. This should be used in conjunction with “latitude”; if either property is outside the valid range, neither will be used. Valid longitudes are between `-180` and `180` degrees; any values of this property outside that range will unset the property in the query URI.

For more information, see the documentation for “latitude”.

Owner: GDataYouTubeQuery

Flags: Read / Write

Default value: 1.79769e+308

Since: 0.3.0

### The `“order-by”` property

      “order-by”                 char *

Specifies the order of entries in a feed. Supported values are `relevance`, `published`, `viewCount` and `rating`.

Additionally, results most relevant to a specific language can be returned by setting the property to `relevance_lang_`languageCode``, where `languageCode` is an ISO 639-1 language code, as used in “language”.

For more information, see the online documentation.

Owner: GDataYouTubeQuery

Flags: Read / Write

Default value: NULL

Since: 0.3.0

### The `“restriction”` property

      “restriction”              char *

An ISO 3166 two-letter country code that should be used to filter videos playable only in specific countries.

Previously, this property could also accept the client’s IP address for country lookup. This feature is no longer supported by Google, and will result in an error from the server if used. Use a country code instead.

For more information, see the online documentation.

Owner: GDataYouTubeQuery

Flags: Read / Write

Default value: NULL

Since: 0.3.0

### The `“safe-search”` property

      “safe-search”              GDataYouTubeSafeSearch

Whether the search results should include restricted content as well as standard content.

For more information, see the online documentation.

Owner: GDataYouTubeQuery

Flags: Read / Write

Default value: GDATA_YOUTUBE_SAFE_SEARCH_MODERATE

Since: 0.3.0

### The `“sort-order”` property

      “sort-order”               GDataYouTubeSortOrder

Specifies the direction of sorting. To use the default sort order, set the property to `GDATA_YOUTUBE_SORT_NONE`.

`GDataYouTubeQuery:sort-order` has been deprecated since version 0.17.0 and should not be used in newly-written code.

No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

Owner: GDataYouTubeQuery

Flags: Read / Write

Default value: GDATA_YOUTUBE_SORT_NONE

Since: 0.3.0

### The `“uploader”` property

      “uploader”                 GDataYouTubeUploader

Restricts the search to videos from the specified type of uploader. Currently, this can only be used to restrict searches to videos from YouTube partners.

`GDataYouTubeQuery:uploader` has been deprecated since version 0.17.0 and should not be used in newly-written code.

No longer supported by Google. The value of this property will be unused in queries. There is no replacement.

Owner: GDataYouTubeQuery

Flags: Read / Write

Default value: GDATA_YOUTUBE_UPLOADER_ALL

Since: 0.3.0