Skip to main content
Glama
bitrefill

Bitrefill Search and Shop

Official
by bitrefill
search.ts3.84 kB
/** * Type definitions for Bitrefill MCP server */ import { z } from "zod"; /** * Search options schema */ export const SearchOptions = { query: z.string().describe("Search query (e.g., 'Amazon', 'Netflix', 'AT&T' or '*' for all the available products)"), country: z.string().optional().describe("Country code (e.g., 'US', 'IT', 'GB')"), language: z.string().optional().describe("Language code for results (e.g., 'en')"), limit: z.number().optional().describe("Maximum number of results to return"), skip: z.number().optional().describe("Number of results to skip (for pagination)"), category: z.string().optional().describe("Filter by category (e.g., 'gaming', 'entertainment')"), beta_flags: z.string().optional().describe("Beta feature flags"), cart: z.string().optional().describe("Cart identifier"), do_recommend: z.number().optional().describe("Enable recommendations"), rec: z.number().optional().describe("Recommendation parameter"), sec: z.number().optional().describe("Security parameter"), col: z.number().optional().describe("Column layout parameter"), prefcc: z.number().optional().describe("Preferred country code parameter"), src: z.string().optional().describe("Source of the request"), }; export const SearchOptionsSchema = z.object(SearchOptions); /** * Search options interface */ export type SearchOptionsType = z.infer<typeof SearchOptionsSchema>; /** * Search result item schema */ export const SearchResultItemSchema = z.object({ id: z.string(), name: z.string(), type: z.string(), url: z.string(), _priceRange: z.string().optional(), _ratingValue: z.number().optional(), _reviewCount: z.number().optional(), baseName: z.string().optional(), billCategories: z.array(z.any()).optional(), cashbackDisabled: z.boolean().optional(), cashbackPercentage: z.number().optional(), cashbackPercentageFinal: z.number().optional(), categories: z.array(z.string()).optional(), countries: z.array(z.string()).optional(), countryCode: z.string().optional(), currency: z.string().optional(), isRanged: z.boolean().optional(), range: z.record(z.any()).optional(), redemptionMethods: z.array(z.string()).optional(), slug: z.string().optional(), usageMethods: z.array(z.string()).optional(), usps: z.array(z.string()).optional(), }); /** * Search result item interface */ export type SearchResultItem = z.infer<typeof SearchResultItemSchema>; /** * Search results schema */ export const SearchResultsSchema = z.object({ results: z.array(SearchResultItemSchema), }); /** * Search results interface */ export type SearchResults = z.infer<typeof SearchResultsSchema>; /** * Product categories map schema */ export const ProductCategoriesMapSchema = z.record(z.array(z.string())); /** * Product types and their associated categories */ export type ProductCategoriesMap = z.infer<typeof ProductCategoriesMapSchema>; /** * API response schema for Bitrefill search */ export const BitrefillSearchResponseSchema = z.object({ products: z.array( z.object({ id: z.string(), name: z.string(), category: z.string(), categories: z.array(z.string()).optional(), countries: z.array(z.string()).optional(), countryCode: z.string().optional(), currency: z.string().optional(), type: z.string().optional(), redemptionMethods: z.array(z.string()).optional(), baseName: z.string().optional(), slug: z.string().optional(), snippet: z.string().optional(), iconPreview: z.string().optional(), }).catchall(z.any()) ), totalCount: z.number().optional(), categories: ProductCategoriesMapSchema.optional(), }).catchall(z.any()); /** * API response interface for Bitrefill search */ export type BitrefillSearchResponse = z.infer<typeof BitrefillSearchResponseSchema>;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bitrefill/bitrefill-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server