1. /search
- Method: GET
- Params:
term(keyword),exclude(optional) - Description: Main search query that returns posts based on title or content. Enhanced filters follow plugin settings.
2. /id/{id}
- Method: GET
- Params: A valid post ID
- Description: Returns the permalink of the post if it’s published. No redirect applied.
3. /recent
- Method: GET
- Params:
page(optional) - Description: Fetch the latest posts, limited by plugin settings. Cached for 5 minutes.
4. /date?value=YYYY, YYYY/MM, YYYY/MM/DD
- Method: GET
- Params:
valuein a flexible date format - Description: Filter posts by year, month, or day. Also works with
/dateslash command.
5. /tax?taxonomy=category&term=slug
- Method: GET
- Params:
taxonomy,term(slug, ID, or multiple values separated by space or comma) - Description: Filter posts by taxonomy (e.g., categories, tags, or custom). Uses AND logic for multiple terms.
6. /related?title=post-title&exclude=ID
- Method: GET
- Params:
title(required),exclude(optional) - Description: Analyze title to fetch related posts. Caching applied if
excludeis not used.
7. /read?ids=1,2,3
- Method: GET
- Params:
idsas a comma-separated list - Description: Return post data based on a list of IDs (e.g., saved in localStorage or used with Init Reading Position plugin).
8. /random
- Method: GET
- Params: None
- Description: Return a permalink to a random post from supported post types.
9. /taxonomies?taxonomy=category
- Method: GET
- Params:
taxonomy(supportscategoryandpost_tag) - Description: Return a sorted list of taxonomy terms by post count. Supports TTL caching.
10. /product
- Method: GET
- Supported Params:
term: Product name keywordsku: Product SKU (partial match allowed)on_sale=1: Filter sale items onlyin_stock=1: Filter in-stock items onlymin_price/max_price: Price rangeprice_order:sort(asc) orrsort(desc)brand,attribute,variation,value: Taxonomy filterspage: Pagination (default: 1)
- Slash Commands:
/product,/on-sale,/stock,/sku,/price - Returned Data:
- Title, URL, current price
- Sale status and stock availability
- Thumbnail image
- Main category (if available)
add_to_cart_urlfor quick cart action
- Caching: Each query is cached for 5 minutes
Example:
/product?page=1&on_sale=1&in_stock=1&sku=ABC&min_price=100&max_price=500
11. /coupon
- Method: GET
- Params: None
- Description: Return active WooCommerce coupons (not expired and within usage limit).
- Returned Data:
- Coupon code
- Description (if available)
- Remaining usage count
- Expiration date
Summary
The Init Live Search REST API system is fully optimized for modern web architecture. All endpoints are cache-aware, easily debuggable, scalable, and tailored for developers building custom frontends, WordPress plugins, or headless applications. Whether you need search, filtering, WooCommerce integration, or reading history – this API provides a reliable and extensible foundation.
Comments