The YQL Web Service has two URLs. The following URL allows access to public data, which does not require authorization:
The next URL requires authorization by OAuth and allows access to both public and private data:
The following URLs are for accessing data from Open Data Tables configured to use YQL streaming. The first URL is used to get public data, and the second requires authorization by OAuth and allows access to both public and private data.
The public URL has a lower rate limit than the OAuth-protected URL. Therefore, if you plan to use YQL heavily, you should access the OAuth-protected URL.
The following table lists the query parameters for the URLs of the YQL Web Service.
||Yes||(none)||The YQL statement to execute, such as SELECT.|
||The format of the results of the call to the YQL Web Service. Allowed values:
||No||(none)||When given the value
||Diagnostic information is returned with the response unless this parameter is set to
Enables network-level logging of each network call within a YQL statement or API query.
For more information, see, Logging Network Calls in Open Data Tables.
||No||(none)||Allows you to use multiple Open Data Tables through a YQL environment file.|
||No||(none)||Enables lossless JSON processing. The only allowed value is
To make YQL Web Service queries easier to remember and share, you can shorten them with query aliases. Take for example a normal YQL REST query:
The corresponding query alias can look like this:
To create a short query alias based on a statement, follow these steps:
If you decide later that you want to start over with a new prefix for your query aliases, you can run the following YQL statement to delete your existing prefix:
delete from yql.queries
Keep in mind that deleting your prefix also deletes all its associated query aliases.
All of your saved query aliases appear along the right side the YQL console under the Query Aliases heading. There, you can click on a alias name to see it in the REST query box. You can also click on the red X next to a particular alias name to delete it.
Query aliases support variable substitution
@ symbol. For example, the following YQL statement searches for questions about poetry that contain the name Auden:
select * from answers.search where query="Auden" and category_id=2115500137 and type="resolved"
Using variable substitution, you can replace
Auden with the
poet. Here is an example:
select * from answers.search where query=@poet and category_id=2115500137 and type="resolved"
A corresponding query alias with the required parameter can look like this: