This function allows you to retrieve multiple random images based on the specified type. Useful for displaying images in a feed or gallery.

You should initialize InitLummi before using this method.

import { SearchImages } from 'lummi'

const { data, success, message } = await SearchImages({
    imageType: '3d',
    limit: 5,
    free: true
})

Props

imageType
string

Specifies the image type: '3d', 'illustrations', or 'images'.

limit
number

Maximum number of results to fetch. Defaults to 1; maximum is 20.

free
boolean

Filters for free images only if true. Includes both free and pro by default.

Return Props

data
Array<Image> | null

The downloand url of the image if success, otherwise null.

Check the Image Interface and what promps it includes.
success
boolean

true if the request was successful, otherwise false.

message
string

A message describing the result of the request.

code
number

200, 400, 401, 403, 404, 500.

Read more about status codes and what they mean.