DeFacto APIdefacto.com ↗
Access DeFacto Turkey fashion products via API. Search items, browse categories, get variant details, filter results, and add to cart programmatically.
What is the DeFacto API?
The DeFacto API covers 5 endpoints for interacting with DeFacto Turkey's apparel catalog, from keyword search to cart management. search_products returns paginated results with fields like DiscountedPrice, ColorName, Stock, Sizes, and CampaignBadge, while get_product_detail exposes the ProductVariantMatrixId values you need to add specific size variants to a cart.
curl -X GET 'https://api.parse.bot/scraper/4fb23c7d-8a75-43c8-a180-b732e963007a/search_products?page=1&query=tshirt' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace defacto-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
from parse_apis.defacto_product_api import DeFacto, ProductSummary, Product, FilterGroup
defacto = DeFacto()
# Search for products
for item in defacto.productsummaries.search(query="tshirt"):
print(item.name, item.price, item.color_name, item.stock)
# Get full product detail from a summary
detail = item.details()
print(detail.product_name, detail.price, detail.stock)
# Browse available sizes
for size in detail.sizes:
print(size.size_name, size.variant_matrix_id)
# Browse available colors
for color in detail.colors:
print(color.color_name, color.html_code)
break
# Browse a category
for product in defacto.productsummaries.by_category(slug="erkek-tisort"):
print(product.long_code, product.name, product.discounted_price)
break
# Get filters for a search query
for group in defacto.filtergroups.for_query(query="elbise"):
print(group.filter_name)
for opt in group.options:
print(opt.label, opt.value, opt.count)
break
# Add a product to cart
result = defacto.cartresults.add(variant_id="a9b8b0ec-070b-4541-8f89-c9101f104122", quantity=1)
print(result.message, result.status_code, result.error_code)
Full-text search over DeFacto Turkey's product catalog. Returns paginated product listings matching the keyword. Each page contains up to 24 products with pricing, color, stock, size, and campaign badge information.
| Param | Type | Description |
|---|---|---|
| page | integer | Page number for pagination. |
| queryrequired | string | Search keyword (e.g. 'tshirt', 'elbise', 'jean'). |
{
"type": "object",
"fields": {
"page": "current page number",
"count": "number of products returned on this page",
"query": "the search query used",
"products": "array of product summary objects"
},
"sample": {
"data": {
"page": 1,
"count": 24,
"query": "tshirt",
"products": [
{
"Name": "Pamuklu Boxy Fit T-shirt",
"Price": 499.99,
"Sizes": [
{
"Barcode": "8684585544221",
"SizeName": "6XL"
}
],
"Stock": 1362,
"LongCode": "H0997AX26SPBK81",
"ColorName": "Siyah",
"CampaignBadge": {
"DiscountAmount": 10,
"CampaignDescription": "Sepette"
},
"DiscountedPrice": 499.99,
"CampaignDiscountedPrice": 449.99
}
]
},
"status": "success"
}
}About the DeFacto API
Search and Category Browsing
The search_products endpoint accepts a required query string (e.g. 'tshirt', 'dress') and an optional page integer for pagination. Each product in the response includes LongCode, Name, Price, DiscountedPrice, ColorName, Stock, Sizes, and CampaignBadge. The get_category_products endpoint works the same way but accepts a category slug (e.g. 'women-dresses', 'men-tshirts') instead of a search keyword. Both endpoints return the same product object shape along with page, count, and the originating query or category slug.
Product Detail and Variant Resolution
get_product_detail takes a product_code (the LongCode surfaced by search and category endpoints) and returns a Data array containing ProductName, a Sizes array where each entry includes a ProductVariantMatrixId, and ProductDetailProductColors for available color variants, plus pictures and full pricing. The ProductVariantMatrixId UUID from any size entry is the value required by add_to_cart.
Filtering and Cart Operations
get_search_filters retrieves filter groups for a given query or category slug. Each filter group has a filter_name and an options array with label, value, and optional count fields — covering dimensions like sort order, gender, category, size, color, and price range. The add_to_cart endpoint accepts a variant_id (the ProductVariantMatrixId) and an optional quantity, returning a Turkish-language confirmation string in Data, a Status integer (1 for success), and an ErrorCode integer (0 for no error).
The DeFacto API is a managed, monitored endpoint for defacto.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when defacto.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official defacto.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a price-tracking tool that monitors
DiscountedPriceandCampaignBadgechanges across DeFacto's catalog. - Aggregate DeFacto category listings by
slugto populate a comparison shopping feed for Turkish apparel. - Automate size availability checks by polling
StockandSizesfields fromsearch_productsfor specific items. - Construct a faceted search UI using filter groups and option counts returned by
get_search_filters. - Resolve product color variants programmatically via
ProductDetailProductColorsfromget_product_detail. - Automate cart population for order testing by chaining
get_product_detailto obtainProductVariantMatrixIdand passing it toadd_to_cart. - Index DeFacto's apparel catalog by category slug for trend analysis across product names and pricing.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does DeFacto have an official public developer API?+
How do I go from a search result to adding a specific size to the cart?+
search_products or get_category_products to get a product's LongCode. Pass that value as product_code to get_product_detail, which returns a Sizes array where each entry contains a ProductVariantMatrixId. Use that UUID as variant_id in add_to_cart along with an optional quantity.Does the API cover user account data such as order history or wishlists?+
Is the DeFacto API limited to Turkey, and are prices in Turkish Lira?+
add_to_cart is also in Turkish. Coverage of other regional DeFacto storefronts is not currently included. You can fork it on Parse and revise to add endpoints targeting other regional domains.What does `get_search_filters` return, and can I use filter values to narrow search results?+
get_search_filters returns an array of filter group objects, each with a filter_name and an options array containing label, value, and an optional count. It accepts either a query string or a category slug. The filter values document what dimensions exist (size, color, price range, gender, etc.), but the search_products and get_category_products endpoints do not currently accept those filter values as direct input parameters. You can fork it on Parse and revise to add filtered search support.