FixFX

API References

Natives

Access FiveM and RedM native functions and documentation.

The Natives API provides comprehensive access to FiveM and RedM native functions, including detailed documentation, parameters, and usage examples. This API helps developers find and understand native functions for both GTA V and Red Dead Redemption 2.

Overview

The Natives API is a powerful tool for accessing native function documentation for FiveM and RedM development. It provides:

  • Complete native function databases for GTA V and RDR3
  • CitizenFX-specific natives and extensions
  • Detailed parameter and return type information
  • Search and filtering capabilities
  • Cross-reference support between different environments

The API covers three main categories:

  • GTA V Natives - Standard Rockstar natives for Grand Theft Auto V
  • RDR3 Natives - Standard Rockstar natives for Red Dead Redemption 2
  • CitizenFX Natives - FiveM/RedM specific extension natives

Base URL

https://fixfx.wiki/api/natives

Authentication

The Natives API is currently public and doesn't require authentication. Rate limiting is applied to ensure fair usage.

Endpoints

GET /api/natives

Retrieves native function information with comprehensive filtering and search capabilities.

Query Parameters

ParameterTypeDescriptionDefault
gamestringTarget game (gta5, rdr3, or cfx)All games
searchstringSearch query for native names or descriptionsNo search
namespacestringFilter by specific namespace (e.g., PLAYER, VEHICLE)All namespaces
environmentstringFilter by environment (client, server, shared)All environments
hashstringGet specific native by hashNo filter
namestringGet specific native by nameNo filter
typestringFilter by return typeAll types
limitnumberMaximum number of results (max 1000)100
offsetnumberNumber of results to skip (for pagination)0
includeDeprecatedbooleanInclude deprecated nativesfalse
sortBystringSort field (name, namespace, hash)name
sortOrderstringSort direction (asc or desc)asc

Response Format

{
  "data": [
    {
      "name": "string",
      "hash": "string",
      "jhash": "string",
      "namespace": "string",
      "description": "string",
      "params": [
        {
          "name": "string",
          "type": "string",
          "description": "string"
        }
      ],
      "results": "string",
      "resultsDescription": "string",
      "environment": "string",
      "game": "string",
      "isCfx": boolean,
      "apiset": "string",
      "deprecated": boolean
    }
  ],
  "metadata": {
    "total": number,
    "filtered": number,
    "games": ["string"],
    "namespaces": ["string"],
    "environments": ["string"],
    "pagination": {
      "limit": number,
      "offset": number,
      "currentPage": number,
      "totalPages": number
    },
    "stats": {
      "gta5": number,
      "rdr3": number,
      "cfx": number,
      "deprecated": number
    }
  }
}

Example Usage

// Search for player-related natives in GTA V
const response = await fetch(
  'https://fixfx.wiki/api/natives?game=gta5&search=player&namespace=PLAYER&limit=20'
);
const data = await response.json();
 
// Process natives
data.data.forEach(native => {
  console.log(`Native: ${native.name}`);
  console.log(`Hash: ${native.hash}`);
  console.log(`Description: ${native.description}`);
  console.log(`Parameters: ${native.params.length}`);
  console.log(`Returns: ${native.results}`);
  
  // Display parameters
  native.params.forEach((param, index) => {
    console.log(`  Param ${index + 1}: ${param.name} (${param.type})`);
    if (param.description) {
      console.log(`    Description: ${param.description}`);
    }
  });
});
 
// Access metadata
console.log(`Total natives found: ${data.metadata.total}`);
console.log(`Available namespaces: ${data.metadata.namespaces.join(', ')}`);

Use Cases

Finding Player Functions

// Find all player-related natives across all games
const response = await fetch(
  'https://fixfx.wiki/api/natives?search=player&environment=client'
);
const data = await response.json();
 
// Filter by specific functionality
const playerIdNatives = data.data.filter(native => 
  native.name.toLowerCase().includes('playerid') ||
  native.description.toLowerCase().includes('player id')
);
 
console.log('Player ID related natives:', playerIdNatives.length);
playerIdNatives.forEach(native => {
  console.log(`${native.name} (${native.game}): ${native.description}`);
});

Cross-Platform Native Discovery

// Compare natives between GTA V and RDR3
async function compareNatives(searchTerm) {
  const [gta5Response, rdr3Response] = await Promise.all([
    fetch(`https://fixfx.wiki/api/natives?game=gta5&search=${searchTerm}`),
    fetch(`https://fixfx.wiki/api/natives?game=rdr3&search=${searchTerm}`)
  ]);
  
  const gta5Data = await gta5Response.json();
  const rdr3Data = await rdr3Response.json();
  
  console.log(`GTA V natives for "${searchTerm}": ${gta5Data.metadata.total}`);
  console.log(`RDR3 natives for "${searchTerm}": ${rdr3Data.metadata.total}`);
  
  // Find common natives by name
  const gta5Names = new Set(gta5Data.data.map(n => n.name));
  const commonNatives = rdr3Data.data.filter(n => gta5Names.has(n.name));
  
  console.log(`Common natives: ${commonNatives.length}`);
  commonNatives.forEach(native => {
    console.log(`- ${native.name}: Available in both games`);
  });
}
 
// Example usage
compareNatives("player");

Native Implementation Helper

// Generate native call templates
async function generateNativeTemplate(nativeName, game = 'gta5') {
  const response = await fetch(
    `https://fixfx.wiki/api/natives?name=${nativeName}&game=${game}`
  );
  const data = await response.json();
  
  if (data.data.length === 0) {
    console.log(`Native "${nativeName}" not found`);
    return;
  }
  
  const native = data.data[0];
  
  // Generate Lua template
  const luaParams = native.params.map(p => `${p.name} --[[${p.type}]]`).join(', ');
  const luaTemplate = `local result = ${native.name}(${luaParams})`;
  
  // Generate JavaScript template
  const jsParams = native.params.map(p => `${p.name} /* ${p.type} */`).join(', ');
  const jsTemplate = `const result = ${native.name}(${jsParams});`;
  
  console.log('Native Information:');
  console.log(`Name: ${native.name}`);
  console.log(`Hash: ${native.hash}`);
  console.log(`Description: ${native.description}`);
  console.log(`Returns: ${native.results}`);
  console.log(`Environment: ${native.environment}`);
  console.log('');
  console.log('Lua Template:');
  console.log(luaTemplate);
  console.log('');
  console.log('JavaScript Template:');
  console.log(jsTemplate);
  console.log('');
  console.log('Parameters:');
  native.params.forEach((param, index) => {
    console.log(`  ${index + 1}. ${param.name} (${param.type})`);
    if (param.description) {
      console.log(`     ${param.description}`);
    }
  });
}
 
// Example usage
generateNativeTemplate('CreateVehicle');

Data Sources

The Natives API aggregates data from multiple sources:

  • Rockstar Native Databases - Official native definitions
  • CitizenFX Documentation - FiveM/RedM specific natives
  • Community Contributions - Enhanced descriptions and examples
  • Automated Analysis - Parameter type inference and validation

Performance Considerations

  • Native data is cached for optimal performance
  • Search operations are optimized with indexing
  • Large result sets support pagination
  • Response compression is enabled

Rate Limiting

  • 200 requests per minute per IP address
  • Burst allowance of 50 requests
  • Headers indicate current rate limit status

Error Handling

Standard HTTP status codes:

  • 200: Success
  • 400: Bad Request - Invalid parameters
  • 404: Not Found - Native not found
  • 429: Too Many Requests - Rate limit exceeded
  • 500: Server Error

Example error response:

{
  "error": "Native not found",
  "message": "No native found with the specified criteria",
  "statusCode": 404
}

Best Practices

  1. Search Optimization

    • Use specific search terms to reduce result sets
    • Combine namespace and environment filters
    • Implement client-side caching for frequently accessed natives
  2. Performance

    • Use pagination for large result sets
    • Cache native information in your application
    • Implement proper error handling and retries
  3. Integration

    • Validate native existence before implementation
    • Cross-reference between game versions
    • Use environment filters for client/server-specific code
  4. Documentation

    • Always include parameter descriptions in your code
    • Reference the native hash for verification
    • Document environment requirements

Support

For questions about the Natives API, please join our Discord. Our community can help with:

  • Native usage examples
  • Cross-platform compatibility
  • Parameter clarification
  • Implementation guidance

The Natives API is continuously updated with new native discoveries and improved documentation.

Always verify native compatibility with your target FiveM/RedM version before implementation.

On this page