Namespace: fetch

lib. fetch

Fetch module.

Author:
  • Taka Okunishi
Source:

Methods

<static> fetchHtml(url, callback)

Fetch html

Parameters:
Name Type Description
url string

URL to fetch.

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:

<static> pixabayApiFetch(queryData, callback)

Pixabay API fetch function.

Parameters:
Name Type Description
queryData object

Query data.

Properties
Name Type Argument Default Description
username string

Pixabay user name.

key string

Pixabay access key.

id string <optional>

id, id_hash, or a comma separated list of values to retrieve details or high resolution URLs of specific images. In a comma separated list, ids and id_hashs cannot be used together. Note: The number of id_hash queries for "response_group=image_details" is limited to 30 images per day and to 350 images in 30 days. The same limit aplies to id queries for "response_group=high_resolution". When over quota, the API tells you to slow down.

search_term string <optional>

A URL encoded string to search for. If omitted, all images are returned in the selected order. Example: "yellow+flower"

lang string <optional>
"en"

Language code of the language to be searched in. Accepted values: id, cs, de, en, es, fr, it, nl, no, hu, ru, pl, pt, ro, fi, sv, tr, ja, ko, zh Default: "en"

image_type string <optional>
"all"

A media type to search within. Accepted values: "all", "photo", "clipart", "vector" Default: "all"

orientation string <optional>
"all"

Whether an image is wider than it is tall, or taller than it is wide. Accepted values: "all", "landscape", "portrait" Default: "all"

min_width string <optional>
"0"

Minimum image width. Default: "0"

min_height string <optional>
"0"

Minimum image height. Default: "0"

editors_choice string <optional>

Select images that have received an Editor's Choice award. Accepted values: "true", "false" Default: "false"

order string <optional>
"popular"

How the results should be ordered. Accepted values: "popular", "latest" Default: "popular"

page string <optional>
1

Returned search results are paginated. Use this parameter to select the page number. Default: 1

per_page string <optional>
20

Determine the number of results per page. Accepted values: 8 - 100 Default: 20

callback function

Callback when done.

Author:
  • Taka Okunishi
Source:
See: