SuggestImageMixin#

class SuggestImageMixin#

Bases: object

Methods Summary

retrieve_image(project_id, image_url)

Returns image in byte format for an image_url :param project_id: Project Identifier :param image_url: url of an image

suggest_images(project_id, term[, ...])

Returns image url suggestions relevant to a term :param project_id: Project Identifier :param term: Term for image suggestion :param num_suggestions: number of suggested image urls

Methods Documentation

retrieve_image(project_id, image_url)#

Returns image in byte format for an image_url :param project_id: Project Identifier :param image_url: url of an image

Example::
>>> client.retrieve_image('Xh9CeyQtTYe2cv5F11e6nQ', 'https://images.pexels.com/photos/3652898/pexels-photo-3652898.jpeg?auto=compress&cs=tinysrgb&h=350')
suggest_images(project_id, term, num_suggestions=15)#

Returns image url suggestions relevant to a term :param project_id: Project Identifier :param term: Term for image suggestion :param num_suggestions: number of suggested image urls

Example:

>>> client.suggest_images('Xh9CeyQtTYe2cv5F11e6nQ', 'apple', num_suggestions=2)
[
    'https://images.pexels.com/photos/3652898/pexels-photo-3652898.jpeg?auto=compress&cs=tinysrgb&h=350', 'https://images.pexels.com/photos/4065876/pexels-photo-4065876.jpeg?auto=compress&cs=tinysrgb&h=350'
]