Skip to main content

API Endpoints

This page documents the core Linkr API endpoints. All endpoints use the base URL https://api.linkr.network/v1.

Hotspots

List Nearby Hotspots

Find hotspots near a geographic location.
/hotspots/nearby

Query Parameters

ParameterTypeRequiredDescription
latnumberYesLatitude (-90 to 90)
lngnumberYesLongitude (-180 to 180)
radiusnumberNoSearch radius in meters (default: 1000, max: 10000)
statusstringNoFilter by status: online, offline, all (default: online)
limitnumberNoMaximum results (default: 20, max: 100)

Example Request

curl "https://api.linkr.network/v1/hotspots/nearby?lat=40.7128&lng=-74.0060&radius=500" \
  -H "Authorization: Bearer lnkr_sk_live_xxxxxxxxxxxx"

Example Response

{
  "data": [
    {
      "id": "hs_7xk2m9p4",
      "name": "Downtown Coffee",
      "type": "business",
      "location": {
        "lat": 40.7131,
        "lng": -74.0055,
        "address": "123 Main St, New York, NY 10001"
      },
      "distance_m": 47,
      "status": "online",
      "coverage_radius_m": 100,
      "signal_quality": "good",
      "performance_tier": "enhanced",
      "current_load": 3,
      "uptime_30d": 0.987
    },
    {
      "id": "hs_a3f2b7c9",
      "name": "Park Side Hotspot",
      "type": "public",
      "location": {
        "lat": 40.7125,
        "lng": -74.0072,
        "address": "City Park, New York, NY 10001"
      },
      "distance_m": 134,
      "status": "online",
      "coverage_radius_m": 150,
      "signal_quality": "excellent",
      "performance_tier": "premium",
      "current_load": 7,
      "uptime_30d": 0.999
    }
  ],
  "meta": {
    "request_id": "req_abc123def456",
    "timestamp": "2024-01-15T14:32:00Z"
  }
}

Create Hotspot

Register a new hotspot. Requires hotspots:write scope.
/hotspots

Request Body

FieldTypeRequiredDescription
namestringYesDisplay name (3-50 characters)
typestringYeshome, business, or public
locationobjectYesLocation details
location.latnumberYesLatitude
location.lngnumberYesLongitude
location.addressstringNoStreet address
deviceobjectYesDevice information
device.ssidstringYesNetwork name
device.mac_addressstringYesDevice MAC address
settingsobjectNoOptional configuration

Example Request

curl -X POST "https://api.linkr.network/v1/hotspots" \
  -H "Authorization: Bearer lnkr_sk_live_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Home Hotspot",
    "type": "home",
    "location": {
      "lat": 40.7128,
      "lng": -74.0060,
      "address": "456 Elm St, New York, NY 10002"
    },
    "device": {
      "ssid": "Linkr-Home",
      "mac_address": "AA:BB:CC:DD:EE:FF"
    },
    "settings": {
      "max_connections": 10,
      "bandwidth_limit_mbps": 25
    }
  }'

Example Response

{
  "data": {
    "id": "hs_n3w1d789",
    "name": "My Home Hotspot",
    "type": "home",
    "status": "pending",
    "location": {
      "lat": 40.7128,
      "lng": -74.0060,
      "address": "456 Elm St, New York, NY 10002",
      "verified": false
    },
    "device": {
      "ssid": "Linkr-Home",
      "mac_address": "AA:BB:CC:DD:EE:FF",
      "linked": false
    },
    "settings": {
      "max_connections": 10,
      "bandwidth_limit_mbps": 25
    },
    "created_at": "2024-01-15T14:32:00Z"
  },
  "meta": {
    "request_id": "req_xyz789abc123",
    "timestamp": "2024-01-15T14:32:00Z"
  }
}
Newly created hotspots have status: pending until location is verified and the device is linked.

Get Hotspot

Retrieve details for a specific hotspot.
/hotspots/{id}

Path Parameters

ParameterTypeDescription
idstringHotspot ID (e.g., hs_7xk2m9p4)

Example Request

curl "https://api.linkr.network/v1/hotspots/hs_7xk2m9p4" \
  -H "Authorization: Bearer lnkr_sk_live_xxxxxxxxxxxx"

Example Response

{
  "data": {
    "id": "hs_7xk2m9p4",
    "name": "Downtown Coffee",
    "type": "business",
    "status": "online",
    "location": {
      "lat": 40.7131,
      "lng": -74.0055,
      "address": "123 Main St, New York, NY 10001",
      "verified": true,
      "verified_at": "2023-11-01T10:00:00Z"
    },
    "device": {
      "ssid": "Linkr-Downtown",
      "mac_address": "11:22:33:44:55:66",
      "linked": true,
      "linked_at": "2023-11-01T10:05:00Z"
    },
    "settings": {
      "max_connections": 20,
      "bandwidth_limit_mbps": 50,
      "operating_hours": null
    },
    "metrics": {
      "uptime_30d": 0.987,
      "connections_24h": 47,
      "bandwidth_used_24h_gb": 12.3,
      "performance_tier": "enhanced"
    },
    "operator_id": "usr_a3f2b7c9",
    "created_at": "2023-11-01T09:45:00Z",
    "updated_at": "2024-01-15T14:00:00Z"
  },
  "meta": {
    "request_id": "req_get456hot789",
    "timestamp": "2024-01-15T14:32:00Z"
  }
}

Update Hotspot

Modify hotspot settings. Only the hotspot’s operator can update it.
/hotspots/{id}

Path Parameters

ParameterTypeDescription
idstringHotspot ID

Request Body

Include only the fields you want to update:
FieldTypeDescription
namestringDisplay name
settings.max_connectionsnumberMaximum simultaneous users
settings.bandwidth_limit_mbpsnumberBandwidth cap
settings.operating_hoursobjectOperating schedule

Example Request

curl -X PATCH "https://api.linkr.network/v1/hotspots/hs_7xk2m9p4" \
  -H "Authorization: Bearer lnkr_sk_live_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "settings": {
      "max_connections": 30,
      "bandwidth_limit_mbps": 75
    }
  }'

Example Response

{
  "data": {
    "id": "hs_7xk2m9p4",
    "name": "Downtown Coffee",
    "settings": {
      "max_connections": 30,
      "bandwidth_limit_mbps": 75,
      "operating_hours": null
    },
    "updated_at": "2024-01-15T14:35:00Z"
  },
  "meta": {
    "request_id": "req_upd123hot456",
    "timestamp": "2024-01-15T14:35:00Z"
  }
}

Rewards

Get User Rewards

Retrieve rewards summary for a user. Requires rewards:read scope.
/users/{id}/rewards

Path Parameters

ParameterTypeDescription
idstringUser ID, or me for authenticated user

Query Parameters

ParameterTypeRequiredDescription
periodstringNoTime period: current, last, all (default: current)

Example Request

curl "https://api.linkr.network/v1/users/me/rewards?period=current" \
  -H "Authorization: Bearer lnkr_sk_live_xxxxxxxxxxxx"

Example Response

{
  "data": {
    "user_id": "usr_a3f2b7c9",
    "period": {
      "start": "2024-01-01T00:00:00Z",
      "end": "2024-01-31T23:59:59Z",
      "status": "in_progress"
    },
    "summary": {
      "total_earned": 1247.50,
      "pending": 423.80,
      "settled": 823.70
    },
    "breakdown": {
      "availability": 748.50,
      "performance": 312.25,
      "utilization": 186.75
    },
    "hotspots": [
      {
        "hotspot_id": "hs_7xk2m9p4",
        "name": "Downtown Coffee",
        "earned": 847.30,
        "availability_score": 0.987,
        "performance_tier": "enhanced"
      },
      {
        "hotspot_id": "hs_x9y8z7w6",
        "name": "Uptown Hub",
        "earned": 400.20,
        "availability_score": 0.952,
        "performance_tier": "standard"
      }
    ]
  },
  "meta": {
    "request_id": "req_rew789usr123",
    "timestamp": "2024-01-15T14:32:00Z"
  }
}

Get Rewards History

Retrieve historical rewards data.
/users/{id}/rewards/history

Query Parameters

ParameterTypeRequiredDescription
start_datestringNoStart date (ISO 8601)
end_datestringNoEnd date (ISO 8601)
pagenumberNoPage number
per_pagenumberNoResults per page

Example Request

curl "https://api.linkr.network/v1/users/me/rewards/history?start_date=2023-01-01&end_date=2023-12-31" \
  -H "Authorization: Bearer lnkr_sk_live_xxxxxxxxxxxx"

Example Response

{
  "data": [
    {
      "period": "2023-12",
      "total_earned": 1523.40,
      "hotspot_count": 2,
      "avg_availability": 0.978
    },
    {
      "period": "2023-11",
      "total_earned": 1412.80,
      "hotspot_count": 2,
      "avg_availability": 0.965
    }
  ],
  "meta": {
    "request_id": "req_hist456789",
    "timestamp": "2024-01-15T14:32:00Z"
  },
  "pagination": {
    "page": 1,
    "per_page": 12,
    "total": 12,
    "total_pages": 1
  }
}

Coverage

Get Coverage for Area

Retrieve coverage data for a geographic bounding box.
/coverage

Query Parameters

ParameterTypeRequiredDescription
northnumberYesNorth bound latitude
southnumberYesSouth bound latitude
eastnumberYesEast bound longitude
westnumberYesWest bound longitude
zoomnumberNoMap zoom level (affects aggregation)

Example Request

curl "https://api.linkr.network/v1/coverage?north=40.75&south=40.70&east=-73.95&west=-74.05" \
  -H "Authorization: Bearer lnkr_sk_live_xxxxxxxxxxxx"

Example Response

{
  "data": {
    "bounds": {
      "north": 40.75,
      "south": 40.70,
      "east": -73.95,
      "west": -74.05
    },
    "hotspot_count": 23,
    "coverage_area_km2": 4.7,
    "coverage_percentage": 0.68,
    "hotspots": [
      {
        "id": "hs_7xk2m9p4",
        "lat": 40.7131,
        "lng": -74.0055,
        "radius_m": 100,
        "status": "online"
      }
    ]
  },
  "meta": {
    "request_id": "req_cov123area456",
    "timestamp": "2024-01-15T14:32:00Z"
  }
}

Error Codes

Common error codes you may encounter:
CodeHTTP StatusDescription
invalid_request400Request parameters are invalid
missing_parameter400Required parameter is missing
unauthorized401Invalid or missing authentication
forbidden403Insufficient permissions
not_found404Resource doesn’t exist
conflict409Resource already exists
rate_limit_exceeded429Too many requests
internal_error500Server error (contact support)

Next Steps