### Getting Started with League of Legends Development Source: https://hextechdocs.dev/author/ray An introductory guide to Hextechdocs and League of Legends developer resources. It aims to provide a foundational understanding for developers starting to build tools and products for League of Legends. ```APIDOC Welcome to Hextechdocs: Purpose: Provide a basic understanding of League of Legends developer resources. Target Audience: Developers new to the League of Legends ecosystem. Prerequisites: None specified, but familiarity with general development concepts is assumed. ``` -------------------------------- ### Getting Started with the Riot Games API Source: https://hextechdocs.dev/tag/getting-started A foundational guide for developers beginning to use the Riot Games API for League of Legends. It emphasizes the importance of reviewing developer policies and legal guidelines before starting a project. The guide covers basic concepts and initial steps. ```APIDOC Riot Games API - Getting Started: Overview: This guide provides the basics for using the Riot Games API for League of Legends. Prerequisites: - Review Riot Games Developer Policies and Legal Jibber Jabber. Key Concepts: - API Endpoints: URLs that provide access to specific data. - API Keys: Required for authentication and making requests. - Request Methods: GET, POST, etc. - Response Formats: Typically JSON. Initial Steps: 1. Obtain an API Key from the Riot Developer Portal. 2. Familiarize yourself with the available API endpoints (e.g., Summoner, Match, Champion). 3. Understand the data structures returned by the API. Important Considerations: - Adhere to rate limits. - Handle API errors gracefully. - Respect user privacy and data usage policies. Resources: - Riot Games Developer Portal (for API key and documentation links) - League of Legends Developer Policies ``` -------------------------------- ### LCU API Request Example Source: https://hextechdocs.dev/getting-started-with-the-lcu-api Demonstrates a typical HTTP GET request to the LCU API, including necessary headers for authentication and host information. This example targets the current summoner endpoint. ```http > GET /lol-summoner/v1/current-summoner HTTP/2 > Host: 127.0.0.1:12345 > Authorization: Basic cmlvdDpwYXNzd29yZA== > User-Agent: insomnia/7.1.1 > Accept: */* < HTTP/2 200 < access-control-allow-origin: https://127.0.0.1:12345 < access-control-expose-headers: content-length < vary: origin < cache-control: no-store < content-length: 382 < content-type: application/json ``` -------------------------------- ### Getting Started With The Riot Games API Source: https://hextechdocs.dev/tag/lol A foundational guide for developers new to the Riot Games API for League of Legends. It emphasizes reading developer policies and legal guidelines before starting projects and covers basic concepts. ```APIDOC Riot Games API - Getting Started: 1. Developer Policies & Legal: - Review Riot Games' developer policies and legal terms before starting. - [Developer Policies](https://developer.riotgames.com/policies/) - [Legal Jibber Jabber](https://developer.riotgames.com/legal/) 2. API Key: - Obtain an API key from the Riot Developer Portal. 3. Endpoints: - Understand the available API endpoints for different game data (e.g., match history, summoner data). 4. Request Structure: - Make HTTP requests to the appropriate endpoints, including your API key in the headers. - Example: `GET https://na1.api.riotgames.com/lol/summoner/v4/summoners/by-name/{summonerName}?api_key={apiKey}` 5. Response Handling: - Parse the JSON responses to extract the required data. - Handle potential errors and rate limiting. ``` -------------------------------- ### Getting Started with the LCU API Source: https://hextechdocs.dev/tag/getting-started This guide introduces developers to the League Client Update (LCU) REST API. It highlights how the community has explored its capabilities to create supplementary tools for the League of Legends client experience. ```APIDOC LCU API - Getting Started: Introduction: The League Client Update (LCU) features a REST API that allows interaction with the client. Purpose: Enables developers to build tools and features that supplement the out-of-game experience for League of Legends. Key Features: - Accessing client data and functionalities. - Potential for creating custom interfaces or integrations. Getting Started: 1. Identify the LCU API endpoints. 2. Understand authentication methods (often involves local client credentials). 3. Use tools like `curl` or programming language libraries (e.g., Python's `requests`) to interact with the API. Example (Conceptual): ```bash # Example of a hypothetical LCU API call to get summoner info # Note: Actual endpoints and authentication methods may vary and require specific setup. curl "https://127.0.0.1:PORT/lol-summoner/v1/current-summoner" \ --cacert "path/to/riotgames.pem" \ -u "user:password" # Basic Auth with client credentials ``` Note: Direct interaction with the LCU API often requires specific security certificates and knowledge of the client's running instance. ``` -------------------------------- ### Getting Started with Riot Games API (League of Legends) Source: https://hextechdocs.dev/tag/riot-api A foundational guide for developers starting with the Riot Games API for League of Legends. It advises reading developer policies and legal information before beginning a project. ```APIDOC Getting Started with Riot Games API (League of Legends) Prerequisites: 1. Review Riot Games Developer Policies and Legal Information. - Link: [Developer Policies](https://developer.riotgames.com/policies/) - Link: [Legal Jibber Jabber](https://developer.riotgames.com/legal/) Initial Steps: - Obtain an API Key from the Riot Developer Portal. - Understand the basic API structure and authentication methods. Core Concepts Covered: - API Endpoints: Understanding available data sources. - Authentication: Securing your API requests. - Data Formats: Typically JSON. Note: This guide provides a basic understanding; explore specific API documentation for detailed usage. ``` -------------------------------- ### Getting Started with Hextechdocs (League of Legends) Source: https://hextechdocs.dev/index An introductory guide to Riot Games developer resources for League of Legends. It aims to provide a foundational understanding for developers starting to build tools and products for the game. ```APIDOC Hextechdocs Introduction (League of Legends): Purpose: Provide basic understanding of LoL developer resources. Target Audience: Developers new to Riot Games APIs. Getting Started: - Familiarize with core concepts and available APIs. - Understand project registration and key management. ``` -------------------------------- ### LCU API Getting Started Guide Source: https://hextechdocs.dev/tag/client This guide provides an introduction to using the League Client Update (LCU) REST API. It covers how to interact with the client for out-of-game features and development. ```APIDOC LCU API Overview: The League Client Update (LCU) provides a REST API that allows developers to interact with the League of Legends client for out-of-game features. Key Concepts: - Endpoints: Specific URLs within the LCU API that provide access to different data and functionalities. - Authentication: Information on how to authenticate requests to the LCU API (details may vary). Usage: Developers can use this API to build custom tools and applications that supplement the League of Legends client experience. Related Resources: - Client LCU - The League Client: Provides general information about the LCU. - ids PUUIDs and Other IDs: Explains the different player IDs used by Riot's APIs. ``` -------------------------------- ### Getting Started with the LCU API Source: https://hextechdocs.dev/tag/lol This guide explains how to interact with the League Client Update (LCU) REST API. It covers the basics of connecting to the API and performing operations to supplement the in-game experience. ```APIDOC LCU API Endpoints: Base URL: https://127.0.0.1:2999 Authentication: Requires a X-Riot-Token header with the token provided by the LCU. Example Request: GET /lol-login/v1/session Headers: X-Riot-Token: Response: { "data": { "accountId": "...", "puuid": "...", "displayName": "..." } } ``` -------------------------------- ### Getting Started with the LCU Websocket Source: https://hextechdocs.dev/tag/getting-started This guide explains how to connect to the League Client Update (LCU) websocket. It details how the LCU uses this connection to communicate real-time changes from the client to the UX process, such as incoming chat messages or friend requests. ```APIDOC LCU Websocket - Getting Started: Overview: The League Client Update (LCU) utilizes a websocket connection for real-time communication. Purpose: To push changes from the LCU to the User Experience (UX) process, enabling features like notifications for friend requests or chat messages. Connection Details: - Protocol: Typically WSS (Websocket Secure). - Endpoint: Usually a local address like `wss://127.0.0.1:PORT`. - Authentication: Requires credentials obtained from the running LCU instance. Usage: - Establish a websocket connection using a suitable library (e.g., `websockets` in Python, `ws` in Node.js). - Subscribe to specific events or topics to receive relevant data. - Process incoming messages (often in JSON format) to update the UI or trigger actions. Example (Conceptual Python using `websockets`): ```python import asyncio import websockets import ssl async def connect_lcu_websocket(): # Certificate validation might need to be handled carefully ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) ssl_context.load_verify_locations(cafile="path/to/riotgames.pem") ssl_context.check_hostname = False ssl_context.verify_mode = ssl.CERT_NONE uri = "wss://127.0.0.1:PORT" # Replace PORT with the actual LCU port async with websockets.connect(uri, ssl=ssl_context, subprotocols=['wamp'], origin="https://riotgames.com") as websocket: # Authentication might be required here, often via Basic Auth headers # Example: await websocket.send(json.dumps({'type': 'auth', 'data': {'username': 'user', 'password': 'password'}})) # Subscribe to events (example: summoner info updates) # await websocket.send(json.dumps({'type': 'subscribe', 'data': {'event': 'OnJsonApiEvent'}})) async for message in websocket: print(f"Received message: {message}") # asyncio.run(connect_lcu_websocket()) ``` Note: The exact port, authentication mechanism, and message formats are specific to the LCU version and may require reverse engineering or community-provided details. ``` -------------------------------- ### Rust Websocket Listener Client Source: https://hextechdocs.dev/getting-started-with-the-lcu-websocket A Rust example demonstrating how to set up a websocket listener client, specifically configured to handle LCU connections with disabled certificate verification. ```Rust /* * A simple WebSocket listener client made in Rust with disabled certificate verification * for dealing with LCU. */ // (Actual code snippet would go here if provided in the source text) ``` -------------------------------- ### Getting Started with the LCU API Source: https://hextechdocs.dev/author/ray This guide introduces developers to the League Client Update (LCU) REST API. It highlights the community's efforts in discovering and utilizing the API's features to enhance the out-of-game experience. ```APIDOC LCU API Introduction: API Type: REST API. Discovery: Community-driven exploration of client features. Focus: Enhancing the out-of-game player experience. Note: Requires understanding of the LCU architecture. ``` -------------------------------- ### Finding LCU Connection Details via Process List Source: https://hextechdocs.dev/getting-started-with-the-lcu-api Demonstrates shell commands to query the operating system's process list for LeagueClientUx.exe to extract the LCU API's port number and authentication token. This method is useful when the installation directory is unknown. ```shell wmic PROCESS WHERE name='LeagueClientUx.exe' GET commandline ``` ```shell ps -A | grep LeagueClientUx ``` -------------------------------- ### Getting Started with the LCU WebSocket Source: https://hextechdocs.dev/tag/lol This guide demonstrates how to connect to the LCU WebSocket to receive real-time updates from the League Client. It covers establishing a connection and handling incoming messages for events like friend requests or chat messages. ```APIDOC LCU WebSocket Connection: URL: wss://127.0.0.1:2999/websocket Authentication: Requires a X-Riot-Token header. Example Connection (using Python): import websocket ws = websocket.create_connection("wss://127.0.0.1:2999/websocket", header={"X-Riot-Token": ""}) # To subscribe to events, send a JSON message: ws.send('{"event":"OnJsonApiEvent","data":{"eventType":"OnLeagueReady"}}') # To receive messages: result = ws.recv() print(result) ``` -------------------------------- ### Application Process for Riot Games API Source: https://hextechdocs.dev/getting-started-with-the-riot-games-api Details the steps and considerations for applying for access to the Riot Games API. Emphasizes the importance of a detailed application, prototype development, and understanding response times. Provides links for application submission and community support. ```en To apply for an application type, visit: https://developer.riotgames.com/app-type Submit your application with detailed information about your project. Building a prototype can improve your chances of getting better rate limits. Response times are approximately 20 business days, so apply well in advance of your release date. For application-specific questions, use the Messages tab in your application. Join the developer discord for further questions: https://discord.gg/riotgamesdevrel ``` -------------------------------- ### Setting Runes using League Client (LCU) with C# Source: https://hextechdocs.dev/getting-started-with-the-riot-games-api Demonstrates how to set runes within the League of Legends client using the PoniLCU C# library. It covers initializing the LeagueClient and provides a basic understanding of how the client handles runes. ```csharp using PoniLCU; // Assuming 'credentials' is an object containing necessary connection details LeagueClient leagueClient = new LeagueClient(credentials.cmd); // Further code to interact with runes would follow... ``` -------------------------------- ### Setting Runes with LCU (C# Example) Source: https://hextechdocs.dev/tag/lor This guide demonstrates how to set runes for League of Legends using the League Client Update (LCU) with a C# library called PoniLCU. It explains the initial setup of the LeagueClient and touches upon how the client internally handles rune data. ```csharp using PoniLCU; // ... inside a method or class LeagueClient leagueClient = new LeagueClient(credentials.cmd); // Further operations to set runes would follow here. ``` -------------------------------- ### Riot Developer Application Process Source: https://hextechdocs.dev/tag/getting-started Guides users on applying for Riot developer projects, distinguishing between testing and production applications, and emphasizing the use of development keys for testing. ```English Apply for a project via 'Register Project' on the dev portal. Use a development key for testing, not a production key. ``` -------------------------------- ### Riot Games API Authentication Header Source: https://hextechdocs.dev/getting-started-with-the-riot-games-api Demonstrates how to authenticate requests to the Riot Games API using the 'X-Riot-Token' header. This is the recommended method for secure and clean authentication. ```APIDOC X-Riot-Token: RGAPI-b529Ax3f-3Y13-4A9d-a9Y2-10Ab9ecc8494 ``` -------------------------------- ### Setting Runes with LCU (C# Example) Source: https://hextechdocs.dev/static-data Demonstrates how to set runes for a League of Legends client using a C# library (PoniLCU). It shows the initial setup of the LeagueClient object and provides context on how the client handles rune data. ```csharp LeagueClient leagueClient = new LeagueClient(credentials.cmd); // Before we dive into it, let's look at what runes are. The client doesn't deal with the runes as the same as you do. ``` -------------------------------- ### Subscribing to LCU Events Source: https://hextechdocs.dev/getting-started-with-the-lcu-websocket Subscribe to specific LCU events by sending a JSON array containing the opcode 5 and the event name as a string. For example, `[5, "OnJsonApiEvent"]` subscribes to all events. ```APIDOC Opcode: 5 Parameters: - Event Name (string): The name of the event to subscribe to (e.g., "OnJsonApiEvent" for all events). Example: [5, "OnJsonApiEvent"] ``` -------------------------------- ### Using Cloudflare Workers for API Calls Source: https://hextechdocs.dev/getting-started-with-the-riot-games-api Discusses overcoming CORS limitations for client-side API calls to Riot Games API. Mentions a previous guide using AWS Lambda and introduces Cloudflare Workers as a more up-to-date and flexible alternative. ```en Guide available at: https://hextechdocs.dev/using-cloudflare-workers-to-make-api-calls/ ``` -------------------------------- ### Setting Runes with LCU API (C# Example) Source: https://hextechdocs.dev/lcu-api-faq An example demonstrating how to set runes using the LCU API with a C# library called PoniLCU. It includes initializing the LeagueClient. ```csharp using PoniLCU; // ... inside a method or class // Initialize LeagueClient with credentials LeagueClient leagueClient = new LeagueClient(credentials.cmd); // Further operations to set runes would follow here... ``` -------------------------------- ### Setting Runes with LCU (C# Example) Source: https://hextechdocs.dev/collecting-data Demonstrates how to set runes using the League Client Update (LCU) with a C# library. It shows the initial setup of the LeagueClient and touches upon how the client handles rune data differently from user perception. ```csharp LeagueClient leagueClient = new LeagueClient(credentials.cmd); // Before we dive into it, let's look at what runes are. The client doesn't deal with the runes as the same as you do. ``` -------------------------------- ### LCU Lockfile Format Source: https://hextechdocs.dev/getting-started-with-the-lcu-api Explains the structure of the LCU lockfile, which contains essential connection details for the API. The file format includes process name, process ID, port number, password, and protocol, separated by colons. ```APIDOC LeagueClient:12345:54321:password:https ``` -------------------------------- ### Getting Started with the LCU API Source: https://hextechdocs.dev/index This guide introduces the League Client Update (LCU) REST API, which allows interaction with the League of Legends client. It covers how to leverage the API for creating supplementary out-of-game experiences. ```en This guide introduces the League Client Update (LCU) REST API, which allows interaction with the League of Legends client. It covers how to leverage the API for creating supplementary out-of-game experiences. ``` -------------------------------- ### Registering Your Application Source: https://hextechdocs.dev/tag/faq Guides users on how to register a personal or production application via the developer portal. It advises against registering solely for API testing, recommending the use of a development key instead. ```English You can apply for a personal or production app by clicking “Register Project” on the main dev portal page. Do not apply for a project if you just want to test the API. If you are developing a project or just testing things out, use your development key that Riot ``` -------------------------------- ### Riot Games API Authentication Query Parameter Source: https://hextechdocs.dev/getting-started-with-the-riot-games-api Illustrates how to authenticate requests to the Riot Games API by including the API key as a query parameter named 'api_key'. This method can be less secure and may require managing additional query parameters. ```APIDOC https://na1.api.riotgames.com/lol/summoner/v4/summoners/by-name/TSMBjergsen?api_key=RGAPI-b529Ax3f-3Y13-4A9d-a9Y2-10Ab9ecc8494 ``` -------------------------------- ### LCU Websocket Connection Source: https://hextechdocs.dev/getting-started-with-the-lcu-websocket Connect to the LCU websocket using the specified URL. Ensure the authorization header is correctly set, similar to LCU API calls. A successful connection will remain open without immediate response. ```APIDOC URL: wss://127.0.0.1:12345/ Headers: Authorization: Basic Connection Status: - Success: Connection remains open. - Failure: Check HTTP response code for errors, likely due to incorrect authorization header. ``` -------------------------------- ### Introduction to Riot Games API Source: https://hextechdocs.dev/author/bangingheads This guide explains the basics of using the Riot Games API for League of Legends. It emphasizes the importance of reviewing Riot Games' developer policies and legal guidelines before starting a project. ```en Getting Started With The Riot Games API This guide is to explain the basics of the Riot Games API for League of Legends. Before getting startedIt is worthwhile to read over the developer policies and legal of Riot Games before starting on your project. Developer Policies Legal Jibber Jabber Although we can't cover it all, at the end of... ``` -------------------------------- ### Collecting Match Data Source: https://hextechdocs.dev/tag/getting-started Outlines a strategy for collecting a large set of match data, starting with a few summoners and progressing to gathering account IDs and match history. ```English Steps for collecting match data: 1. Collect a few summoners (e.g., your own or challenger players). 2. Get the account IDs of those summoners. 3. Retrieve their match history. ``` -------------------------------- ### Setting Runes using League Client Update (LCU) Source: https://hextechdocs.dev/data-dragon This example demonstrates how to set runes within the League of Legends client using the PoniLCU C# library. It covers the initial setup of the LeagueClient and provides insights into how the client handles rune data. ```csharp LeagueClient leagueClient = new LeagueClient(credentials.cmd); // Before we dive into it, let's look at what runes are. The client doesn't deal with the runes as the same as you do. ``` -------------------------------- ### Setting Runes using LCU with C# Lib PoniLCU Source: https://hextechdocs.dev/community-dragon This guide demonstrates how to set runes for League of Legends using the League Client Update (LCU) with the PoniLCU C# library. It provides a basic setup for initializing the LeagueClient and touches upon how the client handles rune data, differentiating it from user perception. ```csharp LeagueClient leagueClient = new LeagueClient(credentials.cmd); ``` -------------------------------- ### Setting Runes using LCU (League Client Update) Source: https://hextechdocs.dev/index This example demonstrates how to set runes for a League of Legends match using the League Client Update (LCU) API with a C# library. It covers the initial setup of the LeagueClient object and provides context on how the client handles runes. ```C# using PoniLCU; // Assuming 'credentials' is an object containing necessary connection details LeagueClient leagueClient = new LeagueClient(credentials.cmd); // Placeholder for rune setting logic // Example: // var runes = new RunePages { PrimaryStyleId = 8000, SecondaryStyleId = 8200 }; // await leagueClient.SetRunePage(runes); // The client doesn't deal with runes in the same way a user might. // Further implementation details would depend on the PoniLCU library's methods for rune management. ``` -------------------------------- ### Replay API Usage Source: https://hextechdocs.dev/tag/getting-started Introduces the Replay API, a game client API for adjusting the in-game camera during replays. It mentions League Director as a starting point for development. ```English Replay API allows adjusting the in-game camera during replays. League Director is a tool that utilizes these APIs. ``` -------------------------------- ### Collecting Match Data Source: https://hextechdocs.dev/author/ray Discusses strategies for collecting a large set of match data, suggesting methods like starting with a few summoners, obtaining account IDs, and iterating through matches. -------------------------------- ### Replay API Source: https://hextechdocs.dev/author/ray Introduces the Replay API for adjusting in-game cameras during replays and mentions League Director as a starting point for development. Highlights that the API is relatively new. -------------------------------- ### Your Application Source: https://hextechdocs.dev/author/ray Guides users on how to apply for personal or production apps via the dev portal's 'Register Project' option. Advises against applying just for testing and recommends using a development key for testing. -------------------------------- ### Getting Started with LCU Websocket Source: https://hextechdocs.dev/index A guide on connecting to the League Client Architecture's websocket connection. This connection is used alongside the LCU REST API to communicate real-time changes from the client to the UX process, such as notifications. ```APIDOC LCU Websocket Connection: Purpose: Real-time communication of client changes to the UX process. Use Cases: Receiving notifications (e.g., friend requests, chat messages). Integration: Works alongside the LCU REST API. Guide Focus: Establishing and utilizing the websocket connection. ``` -------------------------------- ### Constructing API URLs with GET Parameters Source: https://hextechdocs.dev/using-cloudflare-workers-to-make-api-calls Demonstrates how to construct API request URLs, including the use of additional GET parameters. This example shows how to append parameters like 'count' to an endpoint for fetching match data. ```APIDOC Endpoint: /lol/match/v5/matches/by-puuid/{puuid}/ids Region: americas Example puuid: f83au5bQ3XCRxvP3_xAEcki5wnHZ22ZhSkbp5wRpg0j5W-pJnPL_C1q3QVdWBV9xF8g_5ADYduuEZg Constructed URL: https://example.bangingheads.workers.dev/api/?region=americas&endpoint=/lol/match/v5/matches/by-puuid/{puuid}/ids&puuid=f83au5bQ3XCRxvP3_xAEcki5wnHZ22ZhSkbp5wRpg0j5W-pJnPL_C1q3QVdWBV9xF8g_5ADYduuEZg&count=100 ``` -------------------------------- ### Gathering LoL Esports Data Source: https://hextechdocs.dev/tag/lol This guide explains how to gather data from LoL Esports matches by utilizing Leaguepedia, especially after the shutdown of official data APIs. It provides an example using the 'leaguepedia-parser' in Python. ```python from leaguepedia_parser import parse_match_history # Example: Get match history for a specific match ID match_id = "1234567890" match_data = parse_match_history(match_id) print(match_data) ``` -------------------------------- ### Setting Runes using LCU (League Client) Source: https://hextechdocs.dev/your-application Demonstrates how to set runes within the League of Legends Client (LCU) using a C# library called PoniLCU. It covers initializing the LeagueClient and explains how the client handles rune data differently from user perception. ```csharp using PoniLCU; // ... inside a method or class // Assuming 'credentials' is an object holding necessary connection details LeagueClient leagueClient = new LeagueClient(credentials.cmd); // Further logic to set runes would follow here. // The description mentions that the client's internal representation of runes differs from the user's view. ``` -------------------------------- ### Getting Started with Riot API (Mobile Apps & CORS) Source: https://hextechdocs.dev/tag/riot-api Explains how to handle CORS errors when making client-side calls to the Riot API. It emphasizes the need for a backend server to securely manage API keys. ```APIDOC Riot API - Client-Side Calls Problem: Client-side calls to the Riot API are blocked due to CORS policy, as API keys cannot be exposed to users. Solution: Implement a backend server to make API calls securely, protecting your API key. Dependencies: None explicitly mentioned, but a backend framework (e.g., Node.js, Python/Flask, etc.) is required. Input: API key (handled server-side). Output: Data from Riot API endpoints. Limitations: Requires setting up and maintaining a backend infrastructure. ``` -------------------------------- ### Setting Runes using League Client Interface (LCU) Source: https://hextechdocs.dev/item-sets Provides an example using a C# library (PoniLCU) to set runes within the League of Legends client. It covers initializing the LeagueClient and explains how the client handles rune data. ```csharp using PoniLCU; // ... inside a method or class // LeagueClient leagueClient = new LeagueClient(credentials.cmd); // Further code to interact with runes would follow. ``` -------------------------------- ### Unsubscribing from LCU Events Source: https://hextechdocs.dev/getting-started-with-the-lcu-websocket Unsubscribe from LCU events by sending a JSON array with opcode 6 and the event name. Note that you cannot unsubscribe from specific sub-events if you subscribed to a broader event like `OnJsonApiEvent`. ```APIDOC Opcode: 6 Parameters: - Event Name (string): The name of the event to unsubscribe from. Example: [6, "OnJsonApiEvent"] ``` -------------------------------- ### Setting Runes with PoniLCU Source: https://hextechdocs.dev/identifying-champion-positions This example demonstrates how to set runes using the PoniLCU C# library. It covers initializing the LeagueClient and understanding how the client handles rune data. ```C# LeagueClient leagueClient = new LeagueClient(credentials.cmd); ``` -------------------------------- ### Service Rate Limit Example: GET_getFeaturedGames Source: https://hextechdocs.dev/rate-limiting Demonstrates a scenario where the service-level rate limit is exceeded. It shows the impact on API calls to the same service but potentially different methods or routing values, and how the 'Retry-After' header guides subsequent requests. ```APIDOC API: spectator-v3 Method: GET_getFeaturedGames Path: /lol/spectator/v3/featured-games Request URL: https://na1.api.riotgames.com/lol/spectator/v3/featured-games Response Code: 429 Response Headers: Retry-After: 3 X-Rate-Limit-Type: service X-App-Rate-Limit: 20:10 X-App-Rate-Limit-Count: 1:10 X-Method-Rate-Limit: 100:20 X-Method-Rate-Limit-Count: 5:20 Analysis: - Routing value: na1 - Service rate limit exceeded - Service rate limit resets in 3 seconds Expected Responses: API Call | Expected Response | Explanation ---|---|--- | 429 Successful | Service limit exceeded for na1 routing value. | 200 Successful | Service limit not exceeded for la1 routing value. | Unknown | It is unknown if the same service powers both spectator-v3 methods. ``` -------------------------------- ### Riot API Match Data Collection Source: https://hextechdocs.dev/index This guide provides a strategy for collecting a large dataset of matches from the Riot API. It suggests starting with a few summoners, retrieving their account IDs, and then systematically fetching match history. ```JavaScript // Pseudocode for collecting match data async function collectMatchData(summonerNames, region) { const api = new RiotAPIWrapper(region); // Assume a wrapper class exists let allMatchIds = new Set(); for (const summonerName of summonerNames) { try { const summoner = await api.getSummonerByName(summonerName); const accountId = summoner.accountId; // Fetch match list for the account let currentMatchPage = 0; let matchesOnPage; do { matchesOnPage = await api.getMatchListByAccount(accountId, { startIndex: currentMatchPage * 100, // Assuming 100 matches per page endIndex: currentMatchPage * 100 + 99 }); matchesOnPage.matches.forEach(match => allMatchIds.add(match.gameId)); currentMatchPage++; } while (matchesOnPage.matches.length > 0 && currentMatchPage < 10); // Limit pages to avoid excessive calls } catch (error) { console.error(`Error processing summoner ${summonerName}:`, error); } } // Now fetch details for each unique match ID for (const matchId of allMatchIds) { try { const matchDetails = await api.getMatchById(matchId); // Process matchDetails (e.g., save to database) } catch (error) { console.error(`Error fetching match ${matchId}:`, error); } } } // Example usage: // const summoners = ['YourSummonerName', 'AnotherSummoner']; // collectMatchData(summoners, 'na1'); ``` -------------------------------- ### Setting Runes using LCU (League Client Update) Source: https://hextechdocs.dev/welcome-to-hextechdocs This C# code snippet demonstrates how to set runes for a League of Legends client using the PoniLCU library. It shows the initial setup of the LeagueClient object and provides context on how the client handles rune data. ```C# using PoniLCU; // ... inside a method or class // Assuming 'credentials' is an object containing necessary connection details LeagueClient leagueClient = new LeagueClient(credentials.cmd); // Further logic to set runes would follow here. ``` -------------------------------- ### Setting Runes with LCU API (C# Example) Source: https://hextechdocs.dev/tag/lcu-api Demonstrates how to set player runes using the League Client Update (LCU) API with a C# library. It covers initializing the LeagueClient and provides a conceptual overview of rune management within the client. ```C# LeagueClient leagueClient = new LeagueClient(credentials.cmd); // Further code to interact with rune-related API endpoints would follow. ``` -------------------------------- ### League Client Update (LCU) Endpoints Source: https://hextechdocs.dev/tag/getting-started Provides information on using parts of the League Client Update (LCU) for projects, highlighting which endpoints are permitted for use. ```English The LCU (League Client Update) can be used for projects. Consult the documentation for permitted endpoints. ``` -------------------------------- ### Resolving Variables in Champion Spell Texts with DataDragon Source: https://hextechdocs.dev/getting-started-with-the-riot-games-api Explains how to resolve variables found in champion spell descriptions provided by Riot Games' DataDragon. It addresses the common issue of unresolvable variables like {{ wdamage }} in spell texts. ```en DataDragon contains information for all 158 champions. Example spell text: dealing {{ wdamage }} physical damage. This guide helps in understanding how to interpret and resolve such variables. ``` -------------------------------- ### Initialize League Client (C#) Source: https://hextechdocs.dev/how-to-set-runes-using-lcu Initializes the LeagueClient with provided credentials. This is the first step to interacting with the LCU API. ```C# LeagueClient leagueClient = new LeagueClient(credentials.cmd); ``` -------------------------------- ### LCU Websocket Communication (WAMP 1.0) Source: https://hextechdocs.dev/getting-started-with-the-lcu-websocket LCU websockets use WAMP 1.0 protocol, with messages formatted as JSON arrays. Opcodes are used to define message types: 5 for subscribing, 6 for unsubscribing, and 8 for receiving events. ```APIDOC Message Format: JSON Array Opcodes: - 5: Subscribe to an event - 6: Unsubscribe from an event - 8: Receive an event from the client Example Subscribe: [5, "EventName"] Example Unsubscribe: [6, "EventName"] Example Receive: [8, "EventName", { "data": ..., "eventType": ..., "uri": ... }] ``` -------------------------------- ### Creating a Custom Game Lobby Source: https://hextechdocs.dev/lcu-the-league-client This snippet demonstrates how to create a custom game lobby using the LCU's POST /lol-lobby/v2/lobby endpoint. It includes configuration options for game mode, map, and lobby settings. The example shows how to set up a practice tool game. ```APIDOC POST /lol-lobby/v2/lobby { "customGameLobby": { "configuration": { "gameMode": "PRACTICETOOL", "gameMutator": "", "gameServerRegion": "", "mapId": 11, "mutators": {"id": 1}, "spectatorPolicy": "AllAllowed", "teamSize": 5 }, "lobbyName": "Name", "lobbyPassword": null }, "isCustom": true } ``` -------------------------------- ### Getting Started with Mobile Apps and CORS Errors Source: https://hextechdocs.dev/tag/val Explains how to handle client-side calls to the Riot API from mobile applications. It addresses CORS errors by recommending the use of a backend server to securely manage API keys, preventing exposure to users. ```en Client-side calls to the Riot API are blocked because there is no way to make them without exposing your API key to users. You will need to set up a backend server that can make API calls while keeping your API key secure. If you want to quickly set up ``` -------------------------------- ### Applying for Riot API Projects Source: https://hextechdocs.dev/tag/val Guides users on how to apply for personal or production Riot API projects. It advises against applying for a project solely for testing purposes and recommends using a development key for initial testing and development. ```en You can apply for a personal or production app by clicking “Register Project” on the main dev portal page. Do not apply for a project if you just want to test the API. If you are developing a project or just testing things out, use your development key that Riot ``` -------------------------------- ### Fetch Summoner ID by Name Source: https://hextechdocs.dev/getting-started-with-the-riot-games-api This API call retrieves summoner information, including their unique ID, by providing their summoner name and the server region. The response contains various identifiers, with 'id' being the encrypted summoner ID needed for other API calls. ```APIDOC GET https://{region}.api.riotgames.com/lol/summoner/v4/summoners/by-name/{summonerName} Parameters: - region: The server region (e.g., na1, euw1). - summonerName: The name of the summoner to look up (URL encoded). Example Request: https://na1.api.riotgames.com/lol/summoner/v4/summoners/by-name/TSM%20Bjergsen Response Example: { "id": "GNCF41eAxXVw7TVyVN84Jk7iWVUwN_R16ZGDtwS8-2NMpGQ", "accountId": "33yjTTkusyHOCSy3_4WU2kGJ0CyEesx9BydA9DN5U1Qj4pQ", "puuid": "WX9LmetKzMz6wKHE2pR8RMim8nmv9CV6vrWxww4rgBpKG9FnleQHRY7HycMhamfxazFd5rMBjT49kA", "name": "TSM Bjergsen", "profileIconId": 3271, "revisionDate": 1599420939000, "summonerLevel": 242 } ``` -------------------------------- ### Setting Runes using LCU with C# Source: https://hextechdocs.dev/replay-api This guide explains how to set runes using the League Client Update (LCU) with a C# library called PoniLCU. It demonstrates initializing the LeagueClient and provides a basic understanding of how the client handles runes. ```csharp using PoniLCU; // ... // Initialize LeagueClient LeagueClient leagueClient = new LeagueClient(credentials.cmd); // Further steps to set runes would follow here. ```