EDSM-NET / FrontEnd

Issues tracker for EDSM
https://www.edsm.net/
37 stars 0 forks source link

Add traffic report to "Get information about a system" API #45

Closed NoFoolLikeOne closed 6 years ago

NoFoolLikeOne commented 6 years ago

Could you add a traffic report parameter to this API? eg showTraffic=1

https://www.edsm.net/api-v1/system

That system was first discovered for EDSM by timewarp01 on Jun 29, 2016, 3:34:05 PM.

3163 ships passed through Colonia space, including 81 ships in the last 7 days.

17 ships passed through Colonia space in the last 24 hours.

Breakdown:
Anaconda - 3
Asp Explorer - 3
Cobra MkIV - 1
Fer-de-Lance - 1
Imperial Courier - 1
Keelback - 1
Python - 5

Proposed structure in bold

{ name : "Merope", coords : { x : -78.59375, y : -149.625, z : -340.53125 }, information : { allegiance : "Federation", government : "Democracy", faction : "Pleiades Resource Enterprise", factionState : "Expansion", population : 850000, reserve : "Pristine", security : "Medium", economy : "Industrial" }, primaryStar : { type : "B (Blue-White) Star", name : "Merope", isScoopable : true }, traffic :{ total: 3163, week: 81, day: 17 } }

I have two uses for this.

  1. I have a EDMC plugin that uses a slow api call to EDSM. The traffic information combined with a local cache would allow me to avoid calling the EDSM API in areas that have cached data and heavy traffic.

  2. I'd like to write a plugin that can show me the local population and the likelihood of encountering another commander.

AnthorNet commented 6 years ago
{
    "id": 27,
    "id64": 10477373803,
    "name": "Sol",
    "traffic": {
        "total": 7367,
        "week": 356,
        "day": 78
    },
    "breakdown": {
        "Adder": 1,
        "Anaconda": 7,
        "Asp Explorer": 13,
        "Beluga Liner": 2,
        "Cobra MkIII": 2,
        "Diamondback Explorer": 8,
        "Dolphin": 3,
        "Federal Assault Ship": 1,
        "Federal Corvette": 5,
        "Federal Gunship": 1,
        "Fer-de-Lance": 1,
        "Hauler": 1,
        "Imperial Clipper": 1,
        "Imperial Courier": 2,
        "Imperial Cutter": 4,
        "Orca": 2,
        "Python": 17,
        "Type-9 Heavy": 1,
        "Viper MkIII": 1,
        "Viper MkIV": 1,
        "Vulture": 1
    }
}

https://www.edsm.net/api-system-v1/traffic?systemName=Sol

inorton commented 6 years ago

oooh! I like it