How do their APIs compare?
How do their APIs compare?
About iptv-org/iptv · 2 messages · last activity 8/7/2026
These two projects have fundamentally different notions of "API," since one is a data/content repository and the other is a state-management library.
iptv-org/iptv: a data-export "API"
iptv-org/iptv doesn't expose a programmatic API in its own codebase — the README explicitly says API documentation lives in the separate iptv-org/api repository. What lives in this repo is the machinery that builds the underlying playlist/channel data and republishes it:
scripts/api.tsbuilds an in-memory data layer using@iptv-org/sdkmodels (categories, countries, channels, feeds, blocklist records, guides, etc.), all indexed viaDictionary/Collectionhelpers from@freearhey/core[scripts/api.ts:L1-L23]. It exposes asearchChannels(query)function that runs a search index and resolves matching IDs back toChannelobjects [scripts/api.ts:L140-L154], and exportsdata,loadData,downloadData, andsearchChannels[scripts/api.ts:L156].- The GitHub Actions update workflow (
.github/workflows/update.yml) is really the "API surface" consumers rely on indirectly: it runsplaylist:update,playlist:lint,playlist:validate,playlist:generate, andplaylist:exportto produce.api/streams.json, which is then pushed into theiptv-org/apirepo [.github/workflows/update.yml:L30-L75]. - End users interact with the "API" as static file URLs (e.g.,
https://iptv-org.github.io/iptv/index.m3u, or per-source playlists) rather than as function calls — see the README and.readme/template.md[.readme/template.md:L71-L89].
So iptv-org/iptv's "API" is essentially a generated, versioned data artifact (JSON/M3U playlists) plus a thin internal search/query helper (scripts/api.ts), not a request/response service defined in this repo.
statelyai/xstate: a programmatic state-machine API
xstate's API is a proper TypeScript library surface for defining and running state machines/actors. From the retrieved chunks:
- Schema-level API contract:
packages/core/src/machine.schema.jsondefines the JSON Schema for machine configs — state node types (atomic,compound,parallel,final,history), transitions, actions, and initial-transition objects [packages/core/src/machine.schema.json:L1-L40, L141-L215, L281-L320]. This is effectively a formal spec for the shape of machine definitions that the library's public config API accepts. - Runtime equality/comparison helpers used internally by the public API:
areStateNodeCollectionsEqualfor comparing state node sets during transition resolution [packages/core/src/stateUtils.ts:L967-L981], andstateValuesEqualfor comparingStateValues recursively in the testing/graph tooling [packages/core/src/graph/TestModel.ts:L321-L345]. - Framework-binding APIs:
packages/xstate-reactexposes React-specific hooks likeuseSelector, which relies on adefaultCompare(===) function for memoization [packages/xstate-react/src/useSelector.ts:L9-L12], and ashallowEqualutility for comparing selector outputs by shallow key comparison [packages/xstate-react/src/shallowEqual.ts:L10-L38].
Comparison
- Nature: iptv-org/iptv's API is data-oriented and file/artifact-based (playlists, JSON exports); xstate's API is code-oriented — types, schemas, and functions consumed directly in application code.
- Consumption model: iptv-org/iptv consumers fetch static URLs or use the separate
iptv-org/api/@iptv-org/sdkpackages; xstate consumersimportmachine/actor primitives and hooks (e.g.,useSelector) directly into their app. - Validation approach: iptv-org/iptv validates its data via lint/validate scripts in the update pipeline [.github/workflows/update.yml:L36-L38]; xstate validates machine configuration shape declaratively via JSON Schema [packages/core/src/machine.schema.json:L1-L40].
- Internal support code: Both repos rely on equality-comparison utilities, but for different purposes — iptv-org/iptv's
Want to ask your own question?
Open chat for iptv-org/iptvPublic Q&A. Generated by RepoPilot from the actual source of iptv-org/iptv. AI answers can be incomplete or stale — verify before relying on them.