On this page:

5 General

 (require (planet gh/gapi:1:=0))

These are provided by both the gapi/dynamic and gapi/macro modules.


(api-key)  string?

(api-key key)  void?
  key : string?
Your Google API key.

Get an API key from Google’s API Console.

Put your Google API key in a ~/.google-api-key file.


(list-services [#:name name    
  #:label label    
  #:only-preferred? only-preferred?])  jsexpr?
  name : (or/c string? 'N/A) = 'N/A
  label : (or/c string? 'N/A) = 'N/A
  only-preferred? : boolean? = #t
Make a request to the Google API Discovery service to list available services. Supplying #t for only-preferred? limits the results to non-deprecated services or only the latest version of services.


(get-discovery-document name ver)  jsexpr?

  name : string?
  ver : string?
Get the discovery document for the service name and ver. Parse the JSON discovery document using bytes->jsexpr and return the resultng jsexpr?.


(download-discovery-document name ver [path])  any

  name : string?
  ver : string?
  path : path-string? = (string-append name ".js")
Download the discovery document for the service name and ver to the local file path.


(load-discovery-document path)  jsexpr?

  path : path-string?
Load the discovery document.


(paged (function arguments ...))

Make repeated calls to function with arguments if necessary to obtain additional results. If the web service includes a nextPageToken value in the results—indicating that more results are available—then function is called again with arguments plus the additional argument #:pageToken. This repeats until the service no longer returns a nextPageToken. In the returned jsexpr?, the total results are appended into the value for the 'items key.

Keep in mind that you may want to make the calls individually and process the results in small batches. You may want to do this if the total results might be too large to fit in memory, or if you are relaying the results to some other web service that would prefer to take them in small batches, too. However if you really want the results accumuluated for you, use this form.