Skip to main content
client.gamma.search.publicSearch powers discovery in the Polymarket app. Query events, tags, and user profiles with sophisticated filters.

Request

const results = await client.gamma.search.publicSearch(params);

Parameters

NameTypeRequiredDefaultNotes
qstringQuery string.
cachebooleanEnable cached responses.
events_statusstringFilter events by status.
limit_per_typenumber (≥ 0)Result cap per section.
pagenumber (≥ 0)Pagination control.
events_tagstring[]Include events with these tag slugs.
keep_closed_marketsnumber (≥ 0)Retain closed markets.
sortstringSorting expression.
ascendingbooleanSort direction.
search_tagsbooleanToggle tag section.
search_profilesbooleanToggle profile section.
recurrencestringFilter by recurrence (e.g., daily).
exclude_tag_idnumber[]Tag IDs to exclude.
optimizedbooleanRequest optimised payload.

Response

type SearchResponse = {
  events: Event[] | null | undefined;
  tags: Tag[] | null | undefined;
  profiles: Profile[] | null | undefined;
  pagination: { hasMore: boolean; totalResults: number };
};
Each section contains rich metadata—titles, imagery, volume stats, chat info, and more. Check for null/undefined before iterating.

Usage example

const search = await client.gamma.search.publicSearch({
  q: "election",
  search_tags: true,
  search_profiles: true,
  limit_per_type: 10,
});

console.log(search.events?.map((event) => event.title));

Failure modes

  • Missing q → validation error.
  • Negative pagination values → validation error.