{"openapi":"3.1.0","info":{"title":"PersianToolbox Public API","version":"8.0.0","description":"رابط‌های عمومی و بدون کلید PersianToolbox. وضعیت تازگی، منبع و واحد داده را در هر پاسخ بررسی کنید.","license":{"name":"Apache-2.0","identifier":"Apache-2.0"}},"servers":[{"url":"https://persiantoolbox.ir","description":"Production"}],"tags":[{"name":"Market","description":"داده‌های مرجع بازار"},{"name":"Salary","description":"داده نسخه‌دار حقوق و دستمزد"},{"name":"Operations","description":"سلامت، آمادگی و نسخه سرویس"}],"paths":{"/api/market":{"get":{"tags":["Market"],"operationId":"getMarketData","summary":"دریافت نرخ‌های مرجع بازار","description":"نرخ‌های مرجع ارز، طلا و رمزارز را همراه با timestamp، sources، units و freshness برمی‌گرداند. این endpoint نرخ بازار آزاد ایران را تضمین نمی‌کند.","responses":{"200":{"description":"پاسخ موفق","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketResponse"}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/api/data/salary-laws":{"get":{"tags":["Salary"],"operationId":"getSalaryLaws","summary":"دریافت قوانین نسخه‌دار حقوق و دستمزد","parameters":[{"name":"If-None-Match","in":"header","required":false,"schema":{"type":"string"},"description":"ETag پاسخ قبلی برای دریافت 304 در صورت عدم تغییر."}],"responses":{"200":{"description":"مجموعه داده حقوق و دستمزد","headers":{"ETag":{"schema":{"type":"string"}},"Last-Modified":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalaryLawsResponse"}}}},"304":{"description":"داده از زمان ETag ارسالی تغییر نکرده است."},"500":{"$ref":"#/components/responses/InternalError"}}}},"/api/health":{"get":{"tags":["Operations"],"operationId":"getHealth","summary":"بررسی سلامت سرویس","responses":{"200":{"description":"سرویس سالم و پاسخ‌گو است.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"503":{"description":"سرویس پاسخ می‌دهد اما یک یا چند بررسی آمادگی در وضعیت degraded است.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/api/ready":{"get":{"tags":["Operations"],"operationId":"getReadiness","summary":"بررسی آمادگی سرویس","responses":{"200":{"description":"سرویس آماده دریافت ترافیک است.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"503":{"description":"سرویس هنوز آماده نیست."}}}},"/api/version":{"get":{"tags":["Operations"],"operationId":"getVersion","summary":"دریافت نسخه جاری سرویس","responses":{"200":{"description":"اطلاعات نسخه و build.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}}},"components":{"schemas":{"MarketResponse":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","const":true},"data":{"type":"object","required":["timestamp","currencies","gold","crypto","units","sources","freshness"],"properties":{"timestamp":{"type":"integer","description":"Unix timestamp in milliseconds"},"currencies":{"type":"object","additionalProperties":true},"gold":{"type":"object","additionalProperties":true},"crypto":{"type":"object","additionalProperties":true},"units":{"type":"object","required":["currencyBase","iranCurrency","goldPricePerGram","cryptoPrice"],"properties":{"currencyBase":{"type":"string","const":"USD"},"iranCurrency":{"type":"string","const":"IRR"},"goldPricePerGram":{"type":"string","const":"IRR"},"cryptoPrice":{"type":"string","const":"USD"}}},"sources":{"type":"array","items":{"type":"string"}},"freshness":{"type":"string","enum":["live","cached","stale"]}}}}},"SalaryLawsResponse":{"type":"object","required":["version","updatedAt","source","years"],"properties":{"version":{"type":"string"},"updatedAt":{"type":"string","format":"date"},"source":{"type":"string"},"region":{"type":"string"},"years":{"type":"object","additionalProperties":true}}}},"responses":{"InternalError":{"description":"خطای داخلی سرویس","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"string"}}}}}}}}}