Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/sync-openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
env:
DOCS_REPO_TOKEN: ${{ secrets.DOCS_REPO_TOKEN }}
run: |
git clone https://x-access-token:${DOCS_REPO_TOKEN}@github.com/mtauha/psxdata-docs.git /tmp/psxdata-docs
git clone https://x-access-token:${DOCS_REPO_TOKEN}@github.com/psxdata/psxdata-docs.git /tmp/psxdata-docs
cp openapi.json /tmp/psxdata-docs/openapi.json
cd /tmp/psxdata-docs
git config user.name "github-actions[bot]"
Expand Down
22 changes: 11 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Fixed

- Every data endpoint (`/stocks`, `/indices`, `/sectors`, `/sectors/{name}/stocks`, `/screener`) was returning `502 upstream_data_error` since 2026-09-24, because PSX started requiring an `X-Req-Id` request token on its data endpoints and the pinned `psxdata` version had no way to send one. Bumped the `psxdata` pin to `1.1.1`, which fetches and sends the token automatically ([mtauha/psxdata#161](https://github.com/mtauha/psxdata/issues/161)). No API changes on our side.
- Every data endpoint (`/stocks`, `/indices`, `/sectors`, `/sectors/{name}/stocks`, `/screener`) was returning `502 upstream_data_error` since 2026-09-24, because PSX started requiring an `X-Req-Id` request token on its data endpoints and the pinned `psxdata` version had no way to send one. Bumped the `psxdata` pin to `1.1.1`, which fetches and sends the token automatically ([mtauha/psxdata#161](https://github.com/psxdata/psxdata/issues/161)). No API changes on our side.

---

Expand Down Expand Up @@ -80,7 +80,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Fixed

- `GET /sectors/{name}/stocks` no longer returns a bare `500 Internal Server Error`. It called `psxdata.symbols()`, which existed in the SDK's git source but had never been published to PyPI. Bumped the `psxdata` pin to `0.1.0a4`, which ships it (fixes [#1](https://github.com/mtauha/psxdata-api/issues/1)).
- `GET /sectors/{name}/stocks` no longer returns a bare `500 Internal Server Error`. It called `psxdata.symbols()`, which existed in the SDK's git source but had never been published to PyPI. Bumped the `psxdata` pin to `0.1.0a4`, which ships it (fixes [#1](https://github.com/psxdata/psxdata-api/issues/1)).

### Changed

Expand All @@ -92,7 +92,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Fixed

- `GET /stocks?index=<invalid>` no longer returns a bare `500 Internal Server Error`. `PSXParseError` (raised when PSX rejects an unknown index name) is now caught and returns `400 bad_request` with a descriptive message (fixes [#2](https://github.com/mtauha/psxdata-api/issues/2)).
- `GET /stocks?index=<invalid>` no longer returns a bare `500 Internal Server Error`. `PSXParseError` (raised when PSX rejects an unknown index name) is now caught and returns `400 bad_request` with a descriptive message (fixes [#2](https://github.com/psxdata/psxdata-api/issues/2)).
- Pydantic validation failures when building response models from upstream PSX data (e.g. a missing/renamed field) now return `502 upstream_data_error` instead of an opaque `500`, and are logged server-side via `logger.exception` for diagnosis.
- The generic unhandled-exception handler now logs the exception instead of silently discarding it.

Expand All @@ -102,7 +102,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Added

- Initial release — REST API service extracted from [mtauha/psxdata](https://github.com/mtauha/psxdata) with full git history preserved via `git filter-repo`.
- Initial release — REST API service extracted from [mtauha/psxdata](https://github.com/psxdata/psxdata) with full git history preserved via `git filter-repo`.
- `GET /health` — liveness check returning `{"data": {"status": "ok"}, "meta": {"timestamp": ..., "cached": false}}`.
- `GET /stocks` — real-time trading panel data across all 15 board combinations.
- `GET /indices` — all 18 PSX index values.
Expand All @@ -119,13 +119,13 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Known Issues

- `GET /sectors/{name}/stocks` returns an empty list — `psxdata.symbols()` is not yet part of the public `psxdata` API (tracked in [#1](https://github.com/mtauha/psxdata-api/issues/1)).
- `GET /sectors/{name}/stocks` returns an empty list — `psxdata.symbols()` is not yet part of the public `psxdata` API (tracked in [#1](https://github.com/psxdata/psxdata-api/issues/1)).

---

[0.2.1]: https://github.com/mtauha/psxdata-api/releases/tag/v0.2.1
[0.2.0]: https://github.com/mtauha/psxdata-api/releases/tag/v0.2.0
[0.1.3]: https://github.com/mtauha/psxdata-api/releases/tag/v0.1.3
[0.1.2]: https://github.com/mtauha/psxdata-api/releases/tag/v0.1.2
[0.1.1]: https://github.com/mtauha/psxdata-api/releases/tag/v0.1.1
[0.1.0]: https://github.com/mtauha/psxdata-api/releases/tag/v0.1.0
[0.2.1]: https://github.com/psxdata/psxdata-api/releases/tag/v0.2.1
[0.2.0]: https://github.com/psxdata/psxdata-api/releases/tag/v0.2.0
[0.1.3]: https://github.com/psxdata/psxdata-api/releases/tag/v0.1.3
[0.1.2]: https://github.com/psxdata/psxdata-api/releases/tag/v0.1.2
[0.1.1]: https://github.com/psxdata/psxdata-api/releases/tag/v0.1.1
[0.1.0]: https://github.com/psxdata/psxdata-api/releases/tag/v0.1.0
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# psxdata-api — REST API for Pakistan Stock Exchange (PSX) Data

[![CI](https://github.com/mtauha/psxdata-api/actions/workflows/ci.yml/badge.svg)](https://github.com/mtauha/psxdata-api/actions/workflows/ci.yml)
[![CI](https://github.com/psxdata/psxdata-api/actions/workflows/ci.yml/badge.svg)](https://github.com/psxdata/psxdata-api/actions/workflows/ci.yml)
[![Documentation](https://img.shields.io/badge/docs-mintlify-blue)](https://psxdata.mintlify.app/rest-api)
[![API](https://img.shields.io/badge/api-live-brightgreen)](https://psxdata-api.fastapicloud.dev)
[![Docker Hub](https://img.shields.io/docker/v/mtauha/psxdata-api?label=Docker+Hub)](https://hub.docker.com/r/mtauha/psxdata-api)
Expand Down Expand Up @@ -228,6 +228,6 @@ Requires Python 3.11+.

## Related

- **[psxdata](https://github.com/mtauha/psxdata)** — Python library this service wraps
- **[psxdata](https://github.com/psxdata/psxdata)** — Python library this service wraps
- **[psxdata on PyPI](https://pypi.org/project/psxdata/)** — installable package
- **[mtauha/psxdata-api on Docker Hub](https://hub.docker.com/r/mtauha/psxdata-api)** — Docker image
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ dev = [
entrypoint = "api.main:app"

[project.urls]
Homepage = "https://github.com/mtauha/psxdata-api"
Source = "https://github.com/mtauha/psxdata-api"
"Bug Tracker" = "https://github.com/mtauha/psxdata-api/issues"
Homepage = "https://github.com/psxdata/psxdata-api"
Source = "https://github.com/psxdata/psxdata-api"
"Bug Tracker" = "https://github.com/psxdata/psxdata-api/issues"

[tool.setuptools.packages.find]
where = ["."]
Expand Down
Loading