library

Search media library

Search a business's MEDIA library by meaning, returning the best matches first.

This is a semantic (vector) search over each image's alt-text, so it finds relevant images even when the query words don't appear literally. Use it to pick media for a post; for a plain reverse-chronological list use list_library.

By default it returns the business's own, unused, full-size photos: it hides photos posted recently, AI-generated images, and images under 600px on the long side. If nothing passes those filters it returns the best matches without the recency and size filters, and each item's last_used_at shows it was posted before. unused_count says how many unused photos the whole library holds.

Results are a single ranked page (most relevant first), so next is always null — raise limit to get more.

Errors: 400 invalid_value: The business_id is not a valid UUID. 401 authentication_required: API key or token is missing, invalid, or revoked. 403 permission_denied: Your plan does not include API access, or this business is not in your org. 404 resource_not_found: No business with that ID exists. 429 rate_limit_exceeded: You sent too many requests this minute.

get/api/businesses/{business_id}/library/search

Request

  • Base URL: https://api.mymarky.ai
  • URL: https://api.mymarky.ai/api/businesses/{business_id}/library/search
  • Auth: HTTP bearer

Path parameters

business_idstring required

A UUID identifier.

Query parameters

querystring required

What to look for, in plain words (e.g. 'sunset beach', 'team photo').

limitinteger

Max results (1-50)

include_recently_usedboolean

Also return photos posted recently. Leave false unless the user asked to reuse a photo.

include_generatedboolean

Also return AI-generated images and rendered designs. Leave false when you want the business's own photos.

Headers

Marky-Version'2026-04-08' | '2026-07-17' | '2026-08-02' | '2026-08-04' | '2026-08-06'
Example:2026-08-06

Opt into a dated API version. Omit to stay on the floor (2026-04-08) forever — unpinned clients never break. Pin to a newer date (e.g. 2026-08-06) to receive the newest response shapes. Unknown values fall back to the floor. See https://docs.mymarky.ai for the versioning model.

Response

Successful Response

nextstring nullable

Opaque cursor for the next page; null when there are no more. Pass it back verbatim as ?cursor=. Do not construct or decode it.

unused_countinteger required

How many photos in the whole library the default search would offer: not posted recently, not AI-generated, and at least 600px on the long side. 0 means every usable photo was posted recently, so the results are repeats (check each item's last_used_at).

Changes

No recorded changes to this operation across all 1 revision of this API.