As-Mart Product API Documentation

Use the As-Mart Public API to display products, categories, collections, and latest blog content on external websites, affiliate blogs, partner platforms, and ASP.NET Core applications.

API

Overview

The As-Mart API provides public product and content data from As-Mart. Other websites can use it to show featured products, latest products, popular items, deals, top-rated products, category products, collections, related products, and blog posts.

Only active products are returned. Use buyUrl for tracked outbound clicks and productUrl for the As-Mart product detail page.

JSON Responses

All endpoints return clean JSON for websites and apps.

Rate Limited

Public endpoints are protected by rate limiting.

Affiliate Ready

Use buyUrl to keep tracking and redirects controlled.

Base URLs

Product endpoints start with:

https://as-mart.com/api/products

Other public resources:

https://as-mart.com/api/categories
https://as-mart.com/api/collections
https://as-mart.com/api/blogs

Product API Endpoints

Use these endpoints to show As-Mart products on external websites.

GET/api/products/featured?count=12ProductsFeatured products selected by admin.
GET/api/products/latest?count=12ProductsLatest active products.
GET/api/products/popular?count=12ProductsPopular products based on clicks and ratings.
GET/api/products/deals?count=12DealsProducts marked as Deal of the Day.
GET/api/products/top-rated?count=12RatingHighest-rated products.
GET/api/products/random?count=6WidgetsRandom active products for rotating widgets and ads.
GET/api/products/search?q=watch&count=12SearchSearch by title, brand, or short description.
GET/api/products/category/{categorySlug}?count=12CategoryProducts from a specific category slug.
GET/api/products/brand/{brand}?count=12BrandProducts from a specific brand.
GET/api/products/price-range?min=10&max=100&count=12FilterProducts within a price range.
GET/api/products/related/{slug}?count=12RelatedRelated products using product categories.
GET/api/products/collection/{collectionSlug}?count=12CollectionProducts from a public collection.
GET/api/products/home-widget?count=8WidgetReturns featured, deals, popular, and latest products in one response.
GET/api/products/promote/{slug}AdSingle product for advertising/promotion.
GET/api/products/{slug}SingleSingle active product by SEO slug.
The count parameter defaults to 12 and maximum allowed value is 50.

Category API

GET/api/categoriesReturns all public categories with product counts.
GET/api/products/category/{categorySlug}?count=12Returns products for a specific category.

Collection API

GET/api/collectionsReturns all public collections with product counts.
GET/api/products/collection/{collectionSlug}?count=12Returns products from a selected collection.

Blog API

GET/api/blogs/latest?count=6Returns latest As-Mart blog posts for external websites.

Response Models

Product Response

FieldTypeDescription
idintProduct ID.
titlestringProduct title.
slugstringSEO slug.
shortDescriptionstringShort product summary.
brandstringBrand name.
pricedecimalSale price.
listPricedecimalOriginal/list price.
currencystringCurrency code.
FieldTypeDescription
ratingdecimalProduct rating.
ratingCountintTotal ratings.
mainImageUrlstringMain image URL.
productUrlstringAs-Mart product page.
buyUrlstringTracked buy redirect.
isFeaturedboolFeatured flag.
isDealOfTheDayboolDeal flag.
categoriesarrayCategory names.

Product JSON Response

[
  {
    "id": 101,
    "title": "Example Product Title",
    "slug": "example-product-title",
    "shortDescription": "Short product description here.",
    "brand": "Example Brand",
    "price": 49.99,
    "listPrice": 69.99,
    "currency": "USD",
    "rating": 4.6,
    "ratingCount": 1240,
    "mainImageUrl": "https://example.com/product.jpg",
    "productUrl": "https://as-mart.com/product/example-product-title",
    "buyUrl": "https://as-mart.com/product/go/101",
    "isFeatured": true,
    "isDealOfTheDay": false,
    "clickCount": 250,
    "categories": ["Electronics", "Smart Devices"]
  }
]

Home Widget Response

{
  "featured": [],
  "deals": [],
  "popular": [],
  "latest": []
}

JavaScript Fetch Example

fetch("https://as-mart.com/api/products/home-widget?count=6")
  .then(response => response.json())
  .then(data => {
      console.log(data.featured);
      console.log(data.deals);
      console.log(data.popular);
      console.log(data.latest);
  })
  .catch(error => {
      console.error("API Error:", error);
  });

ASP.NET Core HttpClient Example

public class AsMartApiService
{
    private readonly HttpClient _httpClient;

    public AsMartApiService(HttpClient httpClient)
    {
        _httpClient = httpClient;
    }

    public async Task<ProductHomeWidgetApiDto> GetHomeWidgetAsync()
    {
        var result = await _httpClient.GetFromJsonAsync<ProductHomeWidgetApiDto>(
            "https://as-mart.com/api/products/home-widget?count=8");

        return result ?? new ProductHomeWidgetApiDto();
    }
}