HL Gaming Official Search API Documentation - HL Gaming Official




HL Gaming Official Search API Documentation
Welcome to the complete guide for the hlgSearch endpoint of the HL Gaming Official Search API. This single endpoint provides programmatic access to ranked search results across the entire HL Gaming Official site—including posts, guides, troubleshooting articles, and more—via both GET and POST.
Key Features
  • Full‑Text Search & Relevance Ranking: Implements a hybrid TF‑IDF algorithm with heuristic boosts for freshness and user engagement.
  • Label Filtering: Optionally narrow results to a specific content category (e.g., Troubleshooting, Gaming Tools).
  • Multi‑Method Support: Accepts both URL‑encoded GET and JSON POST for flexible integration.
  • Usage Tracking: Every response includes your daily usage stats to help you monitor quota consumption and avoid rate limits.
  • Rich Error Metadata: Detailed error objects with HTTP status codes and human‑readable messages for robust client‑side handling.
🚧 Rate Limit Notice: Requests are subject to a daily quota. Exceeding it returns HTTP 429 Too Many Requests. Always inspect the usage block in responses.
🔐Authentication Required: You must supply valid useruid & apiKey with each call. Never expose these credentials in client‑side scripts.
Endpoint Parameters

All parameters can be provided either as URL query strings (GET) or JSON fields (POST).

Parameter Required Description
sectionName Yes Must be hlgSearch to target the search index.
useruid Yes Your developer ID (USER_UID placeholder).
apiKey Yes Your secret key (API_KEY placeholder).
q Yes Full‑text search query. Supports boolean operators (AND, OR) and phrase matching.
label No Optional filter by content category (e.g., Troubleshooting).
Error Responses
  • 400 Bad Request – Missing/invalid parameters.
  • 401 Unauthorized – Invalid useruid or apiKey.
  • 404 Not Found – No content matches your query/label.
  • 429 Too Many Requests – Rate limit exceeded.
  • 500 Internal Server Error – Server or upstream failure.
API Operations

The HLG Search API provides a single, unified operation—hlgSearch—with two modes:

  • Basic Search: Supply only q to retrieve the top‑ranking results across all categories.
  • Filtered Search: Include label to restrict results to a specific content type.

Both modes return a flat list of up to 50 highest‑scoring items. Results are ordered by relevance score, which combines TF‑IDF text matching with heuristic boosts for recency and engagement.

Example Requests
GET Request:
GET https://hl-gaming-official-main-search-db.vercel.app/api?
 sectionName=hlgSearch
 useruid=USER_UID
 apiKey=API_KEY
 q=Free%20Fire
 label=Troubleshooting
POST Request:
POST https://hl-gaming-official-main-search-db.vercel.app/api
Content-Type: application/json

{
 "sectionName": "hlgSearch",
 "useruid": "USER_UID",
 "apiKey": "API_KEY",
 "q": "Free Fire",
 "label": "Troubleshooting"
}
Example Responses
200 OK – Success:
{
 "source": "HLG Search API",
 "result": [
 &emsp{ "rank": 1, "title": "Free Fire (Free Fire Max) All Problems Solutions", "link": "https://www.hlgamingofficial.com/2024/01/free-fire-free-fire-max-all-problems.html", "imgSrc": "https://…", "author": "HAROON BROKHA", "date": "2024-06-10T07:51:00-07:00", "label": "Troubleshooting" }, {/* … up to 50 items … */}  ],  "usage": { "usedToday": 37, "dailyLimit": 1000, "remainingToday": 963 } }
404 Not Found – No Results:
{
 "error": "No results found for the given query or label."
}
429 Too Many Requests – Rate Limit Exceeded:
{
 "error": "Rate limit exceeded. Try again later."
}
Obtaining Your Credentials
Register at hlgamingofficial.com/p/api.html to receive your USER_UID and API_KEY.
API Usage Examples

Here are GET and POST examples in multiple languages. Swap in your actual USER_UID and API_KEY.


    
FAQ & Best Practices
Q1: How are results ranked?
A: A hybrid of TF‑IDF text match score plus heuristic boosts for content freshness and user engagement metrics.
Q2: Why choose POST over GET?
A: Use GET for simple, cacheable URLs. Use POST when your query is complex or you prefer not to expose it in logs.
Q3: How should I handle errors?
A: Implement retries with exponential back‑off on 429 and 500. Show friendly messages for 404 when no results are found.
Best Practices:
  • Secure your credentials on the server—never in client code.
  • Monitor usage metrics to avoid hitting rate limits.
  • Cache frequent queries in your application or CDN.
  • Analyze search logs to tune labels and query routing.

HL GAMING OFFICIAL FAST VIEW

You are offline. Connect to the internet.
Site Guider Chat