GeoCode API Reference
Overview
The GeoCode API provides access to DragonFire's geometric encoding and transformation system. It enables developers to represent data through optimized geometric patterns, transform data between different dimensional spaces, and apply mathematical transformations based on fundamental constants.
Base URL
https://api.dragonfire.ai/v1/geocode
API Features
- Vector Transformations: Transform data vectors between different dimensional spaces
- Geometric Encoding: Convert data into optimized geometric representations
- Jitterbug Operations: Apply geometric folding patterns to data structures
- Phi-Resonant Processing: Optimize data representation using golden ratio patterns
- R-Space Transformations: Transform data in prime reciprocal spaces
Authentication
The GeoCode API requires authentication using DragonFire API keys. Include your API key in the request headers as shown below.
Authorization: Bearer YOUR_API_KEY
Note: API keys can be generated in the Developer Dashboard. Keys have specific permissions and rate limits based on your subscription tier.
Token-Based Authentication
For applications requiring higher security or user-specific permissions, you can also use JWT tokens, which can be obtained through the RWT Authentication API.
Authorization: Bearer JWT_TOKEN
Error Handling
The GeoCode API uses standard HTTP status codes and returns detailed error information in JSON format.
HTTP Status Codes
Status Code | Description |
---|---|
200 OK | Request succeeded |
400 Bad Request | Invalid parameters or request format |
401 Unauthorized | Missing or invalid authentication |
403 Forbidden | Authentication valid but insufficient permissions |
404 Not Found | Requested resource does not exist |
429 Too Many Requests | Rate limit exceeded |
500 Internal Server Error | Server-side error |
Error Response Format
{
"error": {
"code": "PARAMETER_INVALID",
"message": "Dimension parameter must be between 3 and 13",
"details": {
"parameter": "dimensions",
"provided": 15,
"valid_range": [3, 13]
}
}
}
Common Error Codes
Error Code | Description |
---|---|
AUTHENTICATION_REQUIRED | No authentication provided |
INVALID_API_KEY | API key is not valid |
PARAMETER_REQUIRED | Required parameter is missing |
PARAMETER_INVALID | Parameter value is invalid |
VECTOR_DIMENSION_MISMATCH | Vector dimensions do not match specified parameters |
TRANSFORMATION_ERROR | Error during transformation operation |
RESOURCE_NOT_FOUND | Requested resource does not exist |
RATE_LIMIT_EXCEEDED | API rate limit exceeded |
Rate Limits
The GeoCode API enforces rate limits based on your subscription tier. Rate limits are applied per API key.
Plan | Rate Limit | Burst Limit |
---|---|---|
Developer | 100 requests per minute | 20 concurrent requests |
Professional | 500 requests per minute | 50 concurrent requests |
Enterprise | 2000 requests per minute | 200 concurrent requests |
Rate Limit Headers
The API includes rate limit information in the response headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1677721599
Vector Transformations
Transforms vector data between different dimensional spaces using geometric transformation patterns.
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
data | array | Yes | Source vector data to transform |
source_dimensions | integer | Yes | Number of dimensions in source data (3-13) |
target_dimensions | integer | Yes | Number of dimensions in target data (3-13) |
transformation_type | string | No | Type of transformation: "linear", "harmonic", "phi", "jitterbug" (default: "harmonic") |
preserve_magnitude | boolean | No | Whether to preserve vector magnitude during transformation (default: true) |
precision | string | No | Precision level: "low", "medium", "high" (default: "medium") |
Example Request
POST /v1/geocode/transform HTTP/1.1
Host: api.dragonfire.ai
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"data": [1.0, 2.0, 3.0],
"source_dimensions": 3,
"target_dimensions": 7,
"transformation_type": "phi",
"preserve_magnitude": true,
"precision": "high"
}
Response
{
"result": {
"transformed_data": [0.618, 1.0, 1.618, 2.618, 4.236, 6.854, 11.09],
"source_dimensions": 3,
"target_dimensions": 7,
"transformation_type": "phi",
"magnitude": {
"original": 3.741,
"transformed": 3.741
},
"metrics": {
"phi_resonance": 0.964,
"harmonic_balance": 0.892,
"dimensional_coherence": 0.978
}
}
}
Geometric Encoding
Encodes data into an optimized geometric representation.
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
data | array or object | Yes | Data to encode |
target_geometry | string | Yes | Target geometric form: "tetrahedron", "cube", "octahedron", "dodecahedron", "icosahedron" |
optimization | string | No | Optimization pattern: "phi", "pi", "sqrt2", "sqrt3", "e" (default: "phi") |
precision | string | No | Precision level: "low", "medium", "high" (default: "medium") |
compression | boolean | No | Whether to apply harmonic compression (default: false) |
Example Request
POST /v1/geocode/encode HTTP/1.1
Host: api.dragonfire.ai
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"data": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0],
"target_geometry": "octahedron",
"optimization": "phi",
"precision": "high",
"compression": true
}
Response
{
"result": {
"encoded_data": {
"geometry": "octahedron",
"vertices": [
[1.0, 0.0, 0.0],
[-1.0, 0.0, 0.0],
[0.0, 1.0, 0.0],
[0.0, -1.0, 0.0],
[0.0, 0.0, 1.0],
[0.0, 0.0, -1.0]
],
"faces": [
[0, 2, 4],
[0, 4, 3],
[0, 3, 5],
[0, 5, 2],
[1, 2, 4],
[1, 4, 3],
[1, 3, 5],
[1, 5, 2]
],
"data_mapping": {
"dimension_scaling": [1.618, 2.618, 4.236, 6.854, 11.09, 17.944, 29.034],
"vertex_weights": [0.3, 0.2, 0.15, 0.12, 0.1, 0.08]
}
},
"metrics": {
"phi_resonance": 0.978,
"geometric_coherence": 0.942,
"compression_ratio": 2.4
}
}
}
Geometric Decoding
Decodes data from a geometric representation back to its original form.
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
encoded_data | object | Yes | Geometrically encoded data (from the /encode endpoint) |
output_dimensions | integer | Yes | Number of dimensions for output data (3-13) |
precision | string | No | Precision level: "low", "medium", "high" (default: "medium") |
Example Request
POST /v1/geocode/decode HTTP/1.1
Host: api.dragonfire.ai
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"encoded_data": {
"geometry": "octahedron",
"vertices": [
[1.0, 0.0, 0.0],
[-1.0, 0.0, 0.0],
[0.0, 1.0, 0.0],
[0.0, -1.0, 0.0],
[0.0, 0.0, 1.0],
[0.0, 0.0, -1.0]
],
"faces": [
[0, 2, 4],
[0, 4, 3],
[0, 3, 5],
[0, 5, 2],
[1, 2, 4],
[1, 4, 3],
[1, 3, 5],
[1, 5, 2]
],
"data_mapping": {
"dimension_scaling": [1.618, 2.618, 4.236, 6.854, 11.09, 17.944, 29.034],
"vertex_weights": [0.3, 0.2, 0.15, 0.12, 0.1, 0.08]
}
},
"output_dimensions": 7,
"precision": "high"
}
Response
{
"result": {
"decoded_data": [1.03, 2.01, 2.97, 4.02, 4.96, 6.05, 6.98],
"metrics": {
"reconstruction_accuracy": 0.982,
"geometric_coherence": 0.956,
"dimensional_integrity": 0.974
}
}
}
Jitterbug Operations
Applies Jitterbug transformations to geometric data structures, enabling morphing between different platonic solids.
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
source_geometry | string | Yes | Source geometric form: "tetrahedron", "cube", "octahedron", "dodecahedron", "icosahedron" |
target_geometry | string | Yes | Target geometric form: "tetrahedron", "cube", "octahedron", "dodecahedron", "icosahedron" |
data | object | Yes | Data mapped to the source geometry |
transformation_ratio | number | No | Transformation ratio between source and target (0.0-1.0, default: 1.0) |
preserve_energy | boolean | No | Whether to preserve energy during transformation (default: true) |
Example Request
POST /v1/geocode/jitterbug HTTP/1.1
Host: api.dragonfire.ai
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"source_geometry": "cube",
"target_geometry": "octahedron",
"data": {
"vertices": [
[1.0, 1.0, 1.0],
[1.0, 1.0, -1.0],
[1.0, -1.0, 1.0],
[1.0, -1.0, -1.0],
[-1.0, 1.0, 1.0],
[-1.0, 1.0, -1.0],
[-1.0, -1.0, 1.0],
[-1.0, -1.0, -1.0]
],
"values": [10, 20, 30, 40, 50, 60, 70, 80]
},
"transformation_ratio": 0.75,
"preserve_energy": true
}
Response
{
"result": {
"transformed_geometry": {
"type": "partial_octahedron",
"vertices": [
[0.75, 0.0, 0.0],
[-0.75, 0.0, 0.0],
[0.0, 0.75, 0.0],
[0.0, -0.75, 0.0],
[0.0, 0.0, 0.75],
[0.0, 0.0, -0.75]
],
"values": [32.5, 32.5, 35.0, 35.0, 40.0, 40.0],
"transformation_metrics": {
"completion_ratio": 0.75,
"energy_preservation": 0.998,
"geometric_coherence": 0.934
}
}
}
}
Phi Resonance
Analyzes and optimizes data structures using golden ratio (phi) patterns.
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
data | array | Yes | Data sequence to analyze or optimize |
operation | string | Yes | Operation type: "analyze", "optimize", "generate", "extend" |
depth | integer | No | Analysis depth level (1-7, default: 3) |
target_resonance | number | No | Target phi resonance level (0.0-1.0, default: 0.95) |
preserve_endpoints | boolean | No | Whether to preserve the first and last elements (default: true) |
Example Request
POST /v1/geocode/phi-resonance HTTP/1.1
Host: api.dragonfire.ai
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"data": [1, 3, 7, 12, 20, 33, 54],
"operation": "optimize",
"depth": 4,
"target_resonance": 0.98,
"preserve_endpoints": true
}
Response
{
"result": {
"original_data": [1, 3, 7, 12, 20, 33, 54],
"optimized_data": [1, 3, 5, 8, 13, 21, 54],
"phi_metrics": {
"original_resonance": 0.756,
"optimized_resonance": 0.982,
"sequence_analysis": {
"fibonacci_alignment": 0.964,
"golden_angle_coherence": 0.978,
"phi_ratio_consistency": 0.991
}
},
"phi_patterns": [
{
"type": "ratio",
"locations": [1, 2, 3, 4, 5],
"strength": 0.986
},
{
"type": "spiral",
"center": 3,
"strength": 0.973
}
]
}
}
R-Space Transformations
Transforms data through prime reciprocal spaces for specialized mathematical operations.
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
data | array | Yes | Data to transform |
r_space | string | Yes | Prime reciprocal space: "R7", "R11", "R13" |
operation | string | Yes | Operation type: "project", "rotate", "invert", "harmonize" |
parameters | object | No | Operation-specific parameters |
Example Request
POST /v1/geocode/r-space HTTP/1.1
Host: api.dragonfire.ai
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"data": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0],
"r_space": "R7",
"operation": "rotate",
"parameters": {
"rotation_angle": 1.57,
"rotation_plane": [2, 4],
"normalize": true
}
}
Response
{
"result": {
"transformed_data": [1.0, 2.0, 5.0, 4.0, -3.0, 6.0, 7.0],
"r_space_metrics": {
"space": "R7",
"operation": "rotate",
"preservation": {
"magnitude": 0.998,
"energy": 0.995,
"phase": 0.957
},
"prime_resonance": 0.914
}
}
}
Vector Data
The GeoCode API works with vector data in various formats and dimensionalities.
Data Formats
- Single Vector: An array of numerical values
- Vector Array: An array of vectors
- Vector Map: A key-value mapping of named vectors
- Geometric Object: A structured representation of a geometric form
Examples
// Single Vector
[1.0, 2.0, 3.0, 4.0, 5.0]
// Vector Array
[
[1.0, 2.0, 3.0],
[4.0, 5.0, 6.0],
[7.0, 8.0, 9.0]
]
// Vector Map
{
"position": [1.0, 2.0, 3.0],
"velocity": [0.1, 0.2, 0.3],
"acceleration": [0.01, 0.02, 0.03]
}
// Geometric Object
{
"type": "tetrahedron",
"vertices": [
[1.0, 1.0, 1.0],
[1.0, -1.0, -1.0],
[-1.0, 1.0, -1.0],
[-1.0, -1.0, 1.0]
],
"faces": [
[0, 1, 2],
[0, 1, 3],
[0, 2, 3],
[1, 2, 3]
],
"values": [10, 20, 30, 40]
}
Transformation Parameters
Transformation operations accept various parameters to control the transformation process.
Common Parameters
Parameter | Type | Description |
---|---|---|
preserve_magnitude | boolean | Whether to preserve vector magnitude during transformation |
preserve_energy | boolean | Whether to preserve energy characteristics during transformation |
precision | string | Precision level: "low", "medium", "high" |
optimization | string | Optimization pattern: "phi", "pi", "sqrt2", "sqrt3", "e" |
Operation-Specific Parameters
Operation | Parameter | Type | Description |
---|---|---|---|
jitterbug | transformation_ratio | number | Ratio of transformation (0.0-1.0) |
intermediate_steps | integer | Number of intermediate transformation steps to return | |
return_path | boolean | Whether to return the full transformation path | |
phi-resonance | depth | integer | Analysis depth level (1-7) |
target_resonance | number | Target phi resonance level (0.0-1.0) | |
preserve_endpoints | boolean | Whether to preserve the first and last elements | |
r-space | rotation_angle | number | Rotation angle in radians |
rotation_plane | array | Two dimension indices defining the rotation plane | |
normalize | boolean | Whether to normalize vectors after rotation |
Geometric Objects
The GeoCode API supports various geometric objects for encoding and transforming data.
Supported Geometries
- Point: 0-dimensional point in space
- Line: 1-dimensional line segment between two points
- Triangle: 2-dimensional triangle defined by three points
- Tetrahedron: 3-dimensional solid with four triangular faces
- Cube: 3-dimensional solid with six square faces
- Octahedron: 3-dimensional solid with eight triangular faces
- Dodecahedron: 3-dimensional solid with twelve pentagonal faces
- Icosahedron: 3-dimensional solid with twenty triangular faces
Geometric Object Structure
{
"type": "string", // Geometry type (e.g., "tetrahedron")
"vertices": [
[x1, y1, z1], // Vertex coordinates
[x2, y2, z2],
...
],
"faces": [
[v1, v2, v3], // Vertex indices forming each face
[v4, v5, v6],
...
],
"values": [ // Optional values associated with vertices
value1,
value2,
...
],
"properties": { // Optional additional properties
"property1": value1,
"property2": value2
}
}
Geometric Relationships
Relationship Type | Description |
---|---|
Duality | Relationship between geometric forms where vertices of one form correspond to faces of the other |
Nesting | Relationship where one geometric form fits inside another |
Jitterbug | Dynamic transformation between geometric forms through folding |
Symmetry | Invariance under certain transformations (rotational, reflectional, etc.) |