storelib_rs
A Rust port of StoreLib — a library for interacting with Microsoft Store endpoints to query product information and resolve package download URLs.
Supports native (tokio), WebAssembly, and C / FFI targets.
Features
- Query the Microsoft Store Display Catalog by Product ID, Package Family Name, Xbox Title ID, and more
- Batch lookup — fetch many products in one HTTP round-trip via
bigIds - Resolve direct
.appx/.msix/.eappxdownload URLs via the FE3 delivery service - Typed product accessors —
handler.title(),.price(),.packages(),.images_with_purpose()etc. walk the catalog tree withoutdisplay_sku_availabilities.as_deref()?.first()?...chains - Search the catalog by query string and device family
- 7 endpoints (Production, Int, Xbox, XboxInt, Dev, OneP, OnePInt)
- 259 markets + 185 ISO 639-1 languages + 350 Microsoft Store BCP-47 language tags (sourced from the IANA registry +
learn.microsoft.com's supported-languages table) Locale::from_tag("en-US")/Locale.fromTag("zh-Hant-TW")builds a locale directly from a BCP-47 tag- Optional MSA / XBL3.0 authentication token support for sandboxed and flighted listings
- Real-time progress reporting via a callback on every platform (native closure / JS function / C function pointer)
- Cancellation via
AbortSignal(WASM),CancellationToken(native), orStorelibCancellation(FFI). Cancel from any thread. - Configurable retry + timeout —
ClientConfigexposestimeout,max_retries,initial_backoff,max_backoff,retry_on_status. Cancel-aware backoff returnsCancelledinstantly. - Structured errors in JS — thrown
Errorobjects carry akinddiscriminant ("http" | "json" | "xml" | "notFound" | "timedOut" | "cancelled" | "other") - First-class TypeScript types — every WASM binding is typed (
Promise<DisplayCatalogModel | null>,Promise<PackageInstance[]>, …); no moreanyreturns - camelCase JSON wire format across all bindings; PascalCase from the upstream MS Store API is accepted on the way in
- Structured logging via the
logfacade (env_loggeron native, pluggable on WASM)
Installation
Add to your Cargo.toml:
[]
= { = "https://github.com/query-store-links/storelib_rs" }
For WebAssembly, enable the wasm feature:
[]
= { = "https://github.com/query-store-links/storelib_rs", = ["wasm"] }
Library usage
Query a product
use ;
let mut handler = production;
handler.query_dcat.await?;
if handler.is_found
Batch query (many products in one round-trip)
let ids = ;
handler.query_dcat_batch.await?;
for product in handler.products
query_dcat_batch accepts Microsoft Store Product IDs only — the bigIds endpoint doesn't support alternate identifiers.
Resolve package download URLs
let packages = handler.get_packages_for_product.await?;
for pkg in &packages
Search the catalog
use DeviceFamily;
let results = handler.search_dcat.await?;
println!;
Custom locale and endpoint
use ;
let locale = new;
let mut handler = new;
Building a locale from a BCP-47 tag
use ;
use FromStr;
// "zh-Hant-TW" → Locale { market: TW, language: zh, include_neutral: true }
let tag = from_str?;
let locale = from_tag?;
Authentication (sandboxed / flighted listings)
// MSA token or XBL3.0 token
handler.query_dcat.await?;
// Authenticated package resolution
let packages = handler.get_packages_for_product.await?;
Progress reporting
use ProgressEvent;
handler.set_progress_callback;
Stages emitted during query_dcat / get_packages_for_product / search_dcat:
| Operation | Stages |
|---|---|
query_dcat |
dcat.request → dcat.response → dcat.parse → dcat.done (or dcat.notFound) |
get_packages_for_product |
fe3.start → fe3.getCookie → fe3.syncUpdates → fe3.parseUpdateIds[.done] → fe3.parsePackages[.done] → fe3.resolveUrls[.done] → fe3.done |
search_dcat |
search.request → search.response → search.parse → search.done |
.done counter stages populate current/total with N of N items processed.
JavaScript / WebAssembly usage
import from 'storelib_rs';
// Build a locale directly from a BCP-47 tag.
const locale = ;
const handler = ;
// Subscribe to per-stage progress updates.
handler.;
// Cancel a stalled call after 5s.
const ctrl = ;
setTimeout;
try catch
// Batch lookup — single round-trip for many products.
const products = await handler.;
// Enumerate the full Microsoft Store BCP-47 tag list.
The idType argument to queryDcat is tolerant — "ProductId", "productId", "product-id", and "PRODUCT_ID" all resolve to the same enum.
The handler exposes typed JS getters for common fields: title, description, publisherName, price, prices, packages, availabilities, products, wuCategoryId, lastModifiedDate, plus imagesWithPurpose("Logo" | "Tile" | "Screenshot" | …).
CLI usage
storelib_rs [--log-level <LEVEL>] <COMMAND>
Commands:
packages Fetch direct download URLs for a product's packages
query Query detailed product information
search Search the store catalog
Options:
--log-level <LEVEL> error | warn | info | debug | trace [default: info]
Examples
# Resolve all package URLs for an app
# Query by Package Family Name
# Search for Xbox games
# Authenticated query (flighted / sandbox)
# Debug logging (shows HTTP requests, FE3 update IDs, URL resolution)
# Trace logging (also dumps raw SOAP response bodies)
RUST_LOG overrides --log-level:
RUST_LOG=storelib_rs=debug
Identifier types
--type value |
Description |
|---|---|
product-id (default) |
Microsoft Store Product ID (e.g. 9wzdncrfj3tj) |
pfn |
Package Family Name |
content-id |
Content ID |
xbox-title-id |
Xbox Title ID |
legacy-phone |
Legacy Windows Phone Product ID |
legacy-store |
Legacy Windows Store Product ID |
legacy-xbox |
Legacy Xbox Product ID |
C / FFI usage
Build the shared library with cargo build --release --features ffi. The C header is at include/storelib_rs.h. See the header for the full API; minimal example:
static void
int
Building
# Native
# WebAssembly
# C / FFI shared library + header
# Header is at include/storelib_rs.h
License
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License v3.0 as published by the Free Software Foundation.
See LICENSE for the full text.