{"data":{"billing":{"currency":"USD","mode":"rules","parameters":[],"policy_version":2,"sale":{"addons":[],"base_price_micro_usd":"0","max_cost_micro_usd":"2000","quantities":[{"id":"upstream_credits","label":"Actual API.SH credits consumed","max_quantity":"1","measure":"value","pointer":"/credits_used","price_micro_usd":"2000","quantity_scale":0,"source":"response","unit":"credit","unit_quantity":"1"}],"rounding":"ceil","variants":[]}},"capabilityId":null,"catalogType":"api","categories":["developer","data"],"dataPlatform":"leetcode","dataPlatformLogoUrl":"https://api.sh/logos/leetcode.png","dataPlatformTranslations":{},"dataProduct":"coding-problems","description":"Get LeetCode Contest History data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as output, raw, username, and retrieve structured data including leetCode username, published summary contest rating, contest reference, participation flag, and contest rank to display rating history, and separate participation.","descriptionTranslations":{"ar":"استرجع سجل مسابقات مستخدم LeetCode عبر OpenAny REST لعرض تغير التقييم والمشاركة المنشورة. أرسل الاسم أو الرابط مع attended_only لاستلام المراجع والرتب والتقييمات وأعداد المسائل والتوقيت بصيغة JSON مع سياق كل مسابقة.","ja":"OpenAny REST で LeetCode ユーザーの大会履歴を取得し、公開レーティングや参加記録を表示できます。ユーザー名または URL と attended_only から大会参照、順位、レート、解答数、時間情報を JSON で取得します。","zh":"通过 OpenAny REST 获取 LeetCode 用户竞赛历史，展示公开评分变化与参赛记录。传入用户名或主页链接，可设置 attended_only，返回竞赛引用、名次、评分、解题数及用时 JSON，并保留各场比赛背景。"},"effectContentHtml":"","executionMode":"sync","id":"bed0babe-f6fd-42ef-bcb9-26dcfcb7ddb2","includedContentHtml":"","inputs":[{"description":"LeetCode username or leetcode.com/u/ profile link.","location":"query","name":"username","nullable":false,"required":true,"type":"string"},{"description":"`true` (default): only contests the user took part in.","enum_values":["true","false"],"location":"query","name":"attended_only","nullable":false,"required":false,"type":"string"},{"description":"0 leaves out the bulky `raw` source blocks (often 10-30x smaller).","enum_values":["0","1"],"location":"query","name":"raw","nullable":false,"required":false,"type":"string"},{"description":"Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included.","location":"query","name":"fields","nullable":false,"required":false,"type":"string"},{"description":"1 skips the 24-hour cache and fetches live.","enum_values":["1"],"location":"query","name":"fresh","nullable":false,"required":false,"type":"string"},{"description":"JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.","enum_values":["json"],"location":"query","name":"output","nullable":false,"required":false,"type":"string"},{"description":"With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row.","location":"query","name":"records","nullable":false,"required":false,"type":"string"}],"logoUrl":"https://api.sh/logos/leetcode.png","method":"GET","name":"LeetCode Contest History API","nameTranslations":{"ar":"API سجل مسابقات مستخدمي LeetCode","ja":"LeetCode ユーザー大会履歴 API","zh":"LeetCode 用户竞赛历史 API"},"overviewHtml":"\u003ch2\u003eLeetCode Contest History API\u003c/h2\u003e\n\u003cp\u003eusername is required. attended_only defaults to true; the response includes event entries and summary rating information.\u003c/p\u003e\n\u003ch2\u003eQuick Facts\u003c/h2\u003e\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eFact\u003c/th\u003e\n\u003cth\u003eValue\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003eAccess\u003c/td\u003e\n\u003ctd\u003eOpenAny REST\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eAuthentication\u003c/td\u003e\n\u003ctd\u003eOpenAny API key in the Authorization header\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eCore inputs\u003c/td\u003e\n\u003ctd\u003eRequired inputs: username. Optional: attended_only. JSON only; fresh=1 bypasses cache and raw=0 trims raw source blocks.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eSelected implementation\u003c/td\u003e\n\u003ctd\u003eapish · LeetCode user contest history API\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eBilling\u003c/td\u003e\n\u003ctd\u003eSee the pricing area for the selected implementation and request options\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003ch2\u003eWhat You Can Build\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003eDisplay rating history\u003c/strong\u003e: Keep event and rating paired.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eSeparate participation\u003c/strong\u003e: Preserve attended flags when including other entries.\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2\u003eReturned Data\u003c/h2\u003e\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eField\u003c/th\u003e\n\u003cth\u003eMeaning\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eLeetCode username\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003erating\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003ePublished summary contest rating\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eitems[].contest\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eContest reference\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eitems[].attended\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eParticipation flag\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eitems[].ranking\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eContest rank\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eitems[].problems_solved\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eSolved problem count\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eitems[].rating\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eEvent-associated rating\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003ch2\u003eQuick Start\u003c/h2\u003e\n\u003col\u003e\n\u003cli\u003eSet OPENANY_API_KEY to your OpenAny API key.\u003c/li\u003e\n\u003cli\u003eReview the selected implementation and pricing, then adapt the request below to your target.\u003c/li\u003e\n\u003cli\u003eCheck the HTTP response and business result before reading optional fields.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cpre\u003e\u003ccode class=\"language-bash\"\u003ecurl --request GET --get \\\n  https://api.openany.si/v1/agent-apis/apish/leetcode/v1/user/contests \\\n  -H \u0026#34;Authorization: Bearer ${OPENANY_API_KEY}\u0026#34; \\\n  --data-urlencode output=json \\\n  --data-urlencode raw=0 \\\n  --data-urlencode username=lee215\n\u003c/code\u003e\u003c/pre\u003e\n\u003ch2\u003eRequest and Response Examples\u003c/h2\u003e\n\u003cp\u003eThe response example is a documentation reference and may be abbreviated. The documented request is a calling template; use the published contract and returned response for the selected implementation.\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"https://openany.si/api/v1/agent-apis/bed0babe-f6fd-42ef-bcb9-26dcfcb7ddb2\"\u003ePublished LeetCode Contest History API implementation contract\u003c/a\u003e.\u003c/p\u003e\n\u003ch2\u003ePricing and Billing\u003c/h2\u003e\n\u003cp\u003eThe pricing area reflects the selected API implementation. Review its billing unit and any request-dependent rules before calling; a source service\u0026#39;s public availability does not determine OpenAny billing.\u003c/p\u003e\n\u003ch2\u003eFrequently Asked Questions\u003c/h2\u003e\n\u003ch3\u003eWhat does attended_only default to?\u003c/h3\u003e\n\u003cp\u003etrue.\u003c/p\u003e\n\u003ch3\u003eCan I include other contest entries?\u003c/h3\u003e\n\u003cp\u003eSet attended_only=false and inspect each attended flag.\u003c/p\u003e\n\u003ch3\u003eWhat username formats are supported?\u003c/h3\u003e\n\u003cp\u003eA username or supported leetcode.com/u profile link.\u003c/p\u003e\n\u003ch3\u003eIs global_ranking the rank in every contest?\u003c/h3\u003e\n\u003cp\u003eNo. Per-event ranking and summary global ranking have different scopes.\u003c/p\u003e\n\u003ch3\u003eCan I paginate history?\u003c/h3\u003e\n\u003cp\u003eNo page or cursor parameter is exposed.\u003c/p\u003e\n\u003ch3\u003eCan I request CSV or NDJSON?\u003c/h3\u003e\n\u003cp\u003eThis OpenAny implementation serves JSON only. Omit output or use output=json.\u003c/p\u003e\n\u003ch2\u003eRelated APIs\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://openany.si/market/apis/leetcode/leetcode-contest-api\"\u003eLeetCode contest API\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://openany.si/market/apis/leetcode/leetcode-contest-ranking-api\"\u003eLeetCode contest ranking API\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://openany.si/market/apis/leetcode/leetcode-contests-api\"\u003eLeetCode contests API\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n","pagePath":"/markets/apis/leetcode/leetcode-user-contest-history-api","providerId":"apish","publicPath":"/v1/agent-apis/apish/leetcode/v1/user/contests","requestContentType":"none","revision":3,"samples":[{"http_status":200,"name":"Official example · Live API.SH response · Minimal request","request":{"body":null,"headers":{},"path":{},"query":{"output":"json","raw":"0","username":"lee215"}},"response_body":{"attended":27,"cached":false,"count":27,"credits_used":1,"fetched_at":"2026-11-19T12:29:44.055Z","global_ranking":7647,"items":[{"attended":true,"contest":"Weekly Contest 416","finish_time_seconds":4883,"problems_solved":4,"ranking":2663,"rating":2204.3,"slug":"weekly-contest-416","start":"2024-09-22T02:30:00.000Z","total_problems":4,"trend":"DOWN"},{"attended":true,"contest":"Weekly Contest 176","finish_time_seconds":3192,"problems_solved":4,"ranking":59,"rating":2222.4,"slug":"weekly-contest-176","start":"2020-02-16T02:30:00.000Z","total_problems":4,"trend":"UP"},{"attended":true,"contest":"Weekly Contest 156","finish_time_seconds":1961,"problems_solved":4,"ranking":26,"rating":2163.1,"slug":"weekly-contest-156","start":"2019-09-29T02:30:00.000Z","total_problems":4,"trend":"UP"},{"attended":true,"contest":"Weekly Contest 79","finish_time_seconds":2037,"problems_solved":3,"ranking":217,"rating":2081.3,"slug":"weekly-contest-79","start":"2018-04-08T01:30:00.000Z","total_problems":4,"trend":"DOWN"},{"attended":true,"contest":"Weekly Contest 78","finish_time_seconds":5244,"problems_solved":3,"ranking":76,"rating":2095.4,"slug":"weekly-contest-78","start":"2018-04-01T01:30:00.000Z","total_problems":4,"trend":"UP"},{"attended":true,"contest":"Weekly Contest 77","finish_time_seconds":6394,"problems_solved":4,"ranking":208,"rating":2074.7,"slug":"weekly-contest-77","start":"2018-03-25T01:30:00.000Z","total_problems":4,"trend":"DOWN"},{"attended":true,"contest":"Weekly Contest 76","finish_time_seconds":4219,"problems_solved":3,"ranking":56,"rating":2082.7,"slug":"weekly-contest-76","start":"2018-03-18T01:30:00.000Z","total_problems":4,"trend":"UP"},{"attended":true,"contest":"Weekly Contest 75","finish_time_seconds":6288,"problems_solved":4,"ranking":99,"rating":2052.5,"slug":"weekly-contest-75","start":"2018-03-11T02:30:00.000Z","total_problems":4,"trend":"UP"},{"attended":true,"contest":"Weekly Contest 73","finish_time_seconds":4095,"problems_solved":4,"ranking":125,"rating":2033.7,"slug":"weekly-contest-73","start":"2018-02-25T02:30:00.000Z","total_problems":4,"trend":"UP"},{"attended":true,"contest":"Weekly Contest 72","finish_time_seconds":376,"problems_solved":1,"ranking":689,"rating":2024.1,"slug":"weekly-contest-72","start":"2018-02-18T02:30:00.000Z","total_problems":4,"trend":"DOWN"},{"attended":true,"contest":"Weekly Contest 71","finish_time_seconds":6087,"problems_solved":4,"ranking":24,"rating":2076.2,"slug":"weekly-contest-71","start":"2018-02-11T02:30:00.000Z","total_problems":4,"trend":"UP"},{"attended":true,"contest":"Weekly Contest 69","finish_time_seconds":4528,"problems_solved":4,"ranking":79,"rating":2022.1,"slug":"weekly-contest-69","start":"2018-01-28T02:30:00.000Z","total_problems":4,"trend":"UP"},{"attended":true,"contest":"Weekly Contest 68","finish_time_seconds":2777,"problems_solved":4,"ranking":54,"rating":1992.4,"slug":"weekly-contest-68","start":"2018-01-21T02:30:00.000Z","total_problems":5,"trend":"UP"},{"attended":true,"contest":"Weekly Contest 66","finish_time_seconds":4954,"problems_solved":3,"ranking":352,"rating":1948.1,"slug":"weekly-contest-66","start":"2018-01-07T02:30:00.000Z","total_problems":4,"trend":"DOWN"},{"attended":true,"contest":"Weekly Contest 63","finish_time_seconds":6244,"problems_solved":4,"ranking":53,"rating":1963,"slug":"weekly-contest-63","start":"2017-12-17T02:30:00.000Z","total_problems":4,"trend":"UP"},{"attended":true,"contest":"Weekly Contest 54","finish_time_seconds":5334,"problems_solved":4,"ranking":74,"rating":1920.2,"slug":"leetcode-weekly-contest-54","start":"2017-10-15T01:30:00.000Z","total_problems":4,"trend":"UP"},{"attended":true,"contest":"Weekly Contest 50","finish_time_seconds":3386,"problems_solved":4,"ranking":29,"rating":1872.5,"slug":"leetcode-weekly-contest-50","start":"2017-09-17T01:30:00.000Z","total_problems":4,"trend":"UP"},{"attended":true,"contest":"Weekly Contest 48","finish_time_seconds":3811,"problems_solved":4,"ranking":84,"rating":1793.1,"slug":"leetcode-weekly-contest-48","start":"2017-09-03T01:30:00.000Z","total_problems":4,"trend":"UP"},{"attended":true,"contest":"Weekly Contest 47","finish_time_seconds":6209,"problems_solved":3,"ranking":277,"rating":1736,"slug":"leetcode-weekly-contest-47","start":"2017-08-27T01:30:00.000Z","total_problems":4,"trend":"UP"},{"attended":true,"contest":"Weekly Contest 46","finish_time_seconds":5822,"problems_solved":2,"ranking":690,"rating":1711.7,"slug":"leetcode-weekly-contest-46","start":"2017-08-20T01:30:00.000Z","total_problems":4,"trend":"DOWN"},{"attended":true,"contest":"Weekly Contest 45","finish_time_seconds":5987,"problems_solved":4,"ranking":86,"rating":1723.3,"slug":"leetcode-weekly-contest-45","start":"2017-08-13T01:30:00.000Z","total_problems":4,"trend":"UP"},{"attended":true,"contest":"Weekly Contest 44","finish_time_seconds":3309,"problems_solved":4,"ranking":17,"rating":1656.5,"slug":"leetcode-weekly-contest-44","start":"2017-08-06T01:30:00.000Z","total_problems":4,"trend":"UP"},{"attended":true,"contest":"Weekly Contest 23","finish_time_seconds":1762,"problems_solved":1,"ranking":907,"rating":1516.8,"slug":"leetcode-weekly-contest-23","start":"2017-03-12T02:30:00.000Z","total_problems":4,"trend":"DOWN"},{"attended":true,"contest":"Weekly Contest 19","finish_time_seconds":6534,"problems_solved":3,"ranking":646,"rating":1534.1,"slug":"leetcode-weekly-contest-19","start":"2017-02-12T02:30:00.000Z","total_problems":4,"trend":"DOWN"},{"attended":true,"contest":"Weekly Contest 18B","finish_time_seconds":9468,"problems_solved":4,"ranking":312,"rating":1542.2,"slug":"leetcode-weekly-contest-18b","start":"2017-02-05T02:30:00.000Z","total_problems":4,"trend":"UP"},{"attended":true,"contest":"Weekly Contest 18A","finish_time_seconds":6380,"problems_solved":2,"ranking":375,"rating":1524.8,"slug":"leetcode-weekly-contest-18a","start":"2017-02-04T15:30:00.000Z","total_problems":3,"trend":"DOWN"},{"attended":true,"contest":"Weekly Contest 16A","finish_time_seconds":10184,"problems_solved":2,"ranking":145,"rating":1556.2,"slug":"leetcode-weekly-contest-16a","start":"2017-01-21T15:30:00.000Z","total_problems":3,"trend":"UP"}],"rating":2204,"top_percentage":0.9,"username":"lee215"}}],"seoDescription":"Get LeetCode Contest History data via REST or MCP powered by Apish. Pay per call, no subscription. Get leetCode username and contest reference in JSON.","updatedAt":"2026-12-03T02:44:06.862Z","usageInstructionsHtml":""}}