Git Product home page Git Product logo

wf's Introduction

Random Warframe data api

Random set of Warframe data API endpoints that retrieve data from the Warframe Wiki. If you use this service and notice that there is data missing please contribute to the Warframe Wiki. The data you contribute will be included in responses within one hour of the update of data at the Wikia.

Use of service

The API is currently hosted on url http://wf.snekw.com. Anyone is free to use the endpoint or host this project themselves. The http://wf.snekw.com endpoint is NOT guaranteed to be available all of the time! It is running on my own testing server that may sometimes go down because of other things thar are running on it. If the service is down, please notify me.

Currently existing API endpoints

Api url Module
/weapons-wiki Module:Weapons/data
/mods-wiki Module:Mods/data
/icon-wiki Module:Icon/data
/void-wiki Module:Void/data
/version-wiki Module:Version/data
/warframes-wiki Module:Warframes/data
/warframesConclave-wiki Module:Warframes/Conclave/data
/ability-wiki Module:Ability/data
/focus-wiki Module:Focus/data
/missions-wiki Module:Missions/data
/research-wiki Module:Research/data
/arcane-wiki Module:Arcane/data
/syndicates-wiki Module:Syndicates/data

NOTE: For most up to date API info see http://wf.snekw.com!

All of the API endpoints also have a /meta route. That route can be used to get the metadata of the latest data. Example for /weapons-wiki the hash route would be /weapons-wiki/meta and the returned data would be:

{
    "meta": {
        "nRefresh": 1,
        "lastRefresh": 1526372306650,
        "hash": "mKWrCbLQGqqRd9icbLYUOIma77B9D0JMXa3ovH6gVFo=",
        "license": "CC BY-SA"
    }
}

This route can be used as a pre-update check to save bandwidth. For example the /weapons-data route returns at the time of writing this 281 KB of data and the /weapons-data/meta returns only 297 B of data. Response latency is almost same for both of the routes as they do almost same things server side.

NOTE: The hash can change even if the data hasn't changed! For example server restart will change the hash.

*-wiki endpoints

*-wiki endpoints return JSON data that contains two objects. A data object that contains the module data and a meta object that contains some metadata for the data. All of the data from these urls is from the Warframe Wikia and is under a CC BY-SA license.

Example return for /weapons-wiki:

{
    "data": {
      "Supra Vandal": {},
      "IronBride": {},
    },
    "meta": {
        "nRefresh": 1,
        "lastRefresh": 1526372306650,
        "hash": "mKWrCbLQGqqRd9icbLYUOIma77B9D0JMXa3ovH6gVFo=",
        "license": "CC BY-SA"
    }
}

Headers

All of the request contain a X-Api-Version header that is the short version of the latest commit hash that is running on the server. If for some reason the server isn't yet running the latest version you can see it by comparing the version header.

Errors

If an error occurs during a request the server will return with a response which status is not 200 and the response body will look like this:

{
  "error": {
    "data": {},
    "inner": {},
    "message": ""
  }
}

The inner object contains any errors that happened before the error the top most error. It can contain an inner error itself.

If the server is running with in other mode than production node environment then a stack trace and full error object will also be included. In any normal API use cases the stack trace and full error object will both be excluded.

Dependencies

  • Lua 5.3
  • Node.js 9.9.0 or higher

License

The source code is licensed under GPL-3.0.

All of the Warframe data is from Warframe Wiki and is licensed under CC BY-SA license.

wf's People

Contributors

snekw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wf's Issues

Failing to request data on /void-wiki, /version-wiki, /missions-wiki

Hi Snekw!
I like your API and use it to get Void Relics to track my progress with prime parts.
Unfortunately some APIs have stopped working and I wonder if you can take a look and fix it again.

Thanks in advance for your work! I appreciate it!

https://wf.snekw.com/void-wiki

{
   "error":{
      "message":"Failed at requesting data.",
      "data":{
         
      },
      "inner":{
         "message":"Failed to get lua data.",
         "data":{
            
         },
         "inner":{
            
         },
         "stack":"Error: Failed to get lua data.\n    at getLuaObject.then.catch.err (/var/www/Wf/cache.js:110:31)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:182:7)",
         "full":{
            "error":"lua5.3: [string \"...\"]:13: module 'Module:Shared' not found:\n\tno field package.preload['Module:Shared']\n\tno file '/usr/local/share/lua/5.3/Module:Shared.lua'\n\tno file '/usr/local/share/lua/5.3/Module:Shared/init.lua'\n\tno file '/usr/local/lib/lua/5.3/Module:Shared.lua'\n\tno file '/usr/local/lib/lua/5.3/Module:Shared/init.lua'\n\tno file '/usr/share/lua/5.3/Module:Shared.lua'\n\tno file '/usr/share/lua/5.3/Module:Shared/init.lua'\n\tno file './Module:Shared.lua'\n\tno file './Module:Shared/init.lua'\n\tno file '/usr/local/lib/lua/5.3/Module:Shared.so'\n\tno file '/usr/lib/x86_64-linux-gnu/lua/5.3/Module:Shared.so'\n\tno file '/usr/lib/lua/5.3/Module:Shared.so'\n\tno file '/usr/local/lib/lua/5.3/loadall.so'\n\tno file './Module:Shared.so'\nstack traceback:\n\t[C]: in function 'require'\n\t[string \"...\"]:13: in local 'f'\n\t./luaObjectToJson.lua:25: in main chunk\n\t[C]: in ?\n"
         }
      },
      "stack":"Error: Failed at requesting data.\n    at Cache._getRequest.then.catch.err (/var/www/Wf/cache.js:164:29)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:182:7)",
      "full":{
         "error":{
            "error":"lua5.3: [string \"...\"]:13: module 'Module:Shared' not found:\n\tno field package.preload['Module:Shared']\n\tno file '/usr/local/share/lua/5.3/Module:Shared.lua'\n\tno file '/usr/local/share/lua/5.3/Module:Shared/init.lua'\n\tno file '/usr/local/lib/lua/5.3/Module:Shared.lua'\n\tno file '/usr/local/lib/lua/5.3/Module:Shared/init.lua'\n\tno file '/usr/share/lua/5.3/Module:Shared.lua'\n\tno file '/usr/share/lua/5.3/Module:Shared/init.lua'\n\tno file './Module:Shared.lua'\n\tno file './Module:Shared/init.lua'\n\tno file '/usr/local/lib/lua/5.3/Module:Shared.so'\n\tno file '/usr/lib/x86_64-linux-gnu/lua/5.3/Module:Shared.so'\n\tno file '/usr/lib/lua/5.3/Module:Shared.so'\n\tno file '/usr/local/lib/lua/5.3/loadall.so'\n\tno file './Module:Shared.so'\nstack traceback:\n\t[C]: in function 'require'\n\t[string \"...\"]:13: in local 'f'\n\t./luaObjectToJson.lua:25: in main chunk\n\t[C]: in ?\n"
         }
      }
   }
}

https://wf.snekw.com/version-wiki

{
   "error":{
      "message":"Failed at requesting data.",
      "data":{
         
      },
      "inner":{
         "message":"Failed to get lua data.",
         "data":{
            
         },
         "inner":{
            
         },
         "stack":"Error: Failed to get lua data.\n    at getLuaObject.then.catch.err (/var/www/Wf/cache.js:110:31)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:182:7)",
         "full":{
            "error":"lua5.3: ./json.lua:73: invalid table: mixed or invalid key types\nstack traceback:\n\t[C]: in function 'error'\n\t./json.lua:73: in function <./json.lua:59>\n\t(...tail calls...)\n\t./json.lua:93: in function <./json.lua:59>\n\t(...tail calls...)\n\t./json.lua:93: in function <./json.lua:59>\n\t(...tail calls...)\n\t./json.lua:138: in function 'json.encode'\n\t./luaObjectToJson.lua:26: in main chunk\n\t[C]: in ?\n"
         }
      },
      "stack":"Error: Failed at requesting data.\n    at Cache._getRequest.then.catch.err (/var/www/Wf/cache.js:164:29)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:182:7)",
      "full":{
         "error":{
            "error":"lua5.3: ./json.lua:73: invalid table: mixed or invalid key types\nstack traceback:\n\t[C]: in function 'error'\n\t./json.lua:73: in function <./json.lua:59>\n\t(...tail calls...)\n\t./json.lua:93: in function <./json.lua:59>\n\t(...tail calls...)\n\t./json.lua:93: in function <./json.lua:59>\n\t(...tail calls...)\n\t./json.lua:138: in function 'json.encode'\n\t./luaObjectToJson.lua:26: in main chunk\n\t[C]: in ?\n"
         }
      }
   }
}

https://wf.snekw.com/missions-wiki

{
   "error":{
      "message":"Failed at requesting data.",
      "data":{
         
      },
      "inner":{
         "message":"Failed to get lua data.",
         "data":{
            
         },
         "inner":{
            
         },
         "stack":"Error: Failed to get lua data.\n    at getLuaObject.then.catch.err (/var/www/Wf/cache.js:110:31)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:182:7)",
         "full":{
            "error":"lua5.3: [string \"local MissionData = {...\"]:357: attempt to call a table value (field 'vars')\nstack traceback:\n\t[string \"local MissionData = {...\"]:357: in local 'f'\n\t./luaObjectToJson.lua:25: in main chunk\n\t[C]: in ?\n"
         }
      },
      "stack":"Error: Failed at requesting data.\n    at Cache._getRequest.then.catch.err (/var/www/Wf/cache.js:164:29)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:182:7)",
      "full":{
         "error":{
            "error":"lua5.3: [string \"local MissionData = {...\"]:357: attempt to call a table value (field 'vars')\nstack traceback:\n\t[string \"local MissionData = {...\"]:357: in local 'f'\n\t./luaObjectToJson.lua:25: in main chunk\n\t[C]: in ?\n"
         }
      }
   }
}

Failing to request data on /weapon-wiki

/weapon-wiki respond with error 500.

{
  "error": {
    "message": "Failed at requesting data.",
    "data": {},
    "inner": {
      "message": "Failed to get lua data.",
      "data": {},
      "inner": {},
      "stack": "Error: Failed to get lua data.\n    at getLuaObject.then.catch.err (/var/www/Wf/cache.js:110:31)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:182:7)",
      "full": {
        "error": "lua5.3: ./json.lua:94: unexpected number value '-inf'\nstack traceback:\n\t[C]: in function 'error'\n\t./json.lua:94: in function <./json.lua:91>\n\t(...tail calls...)\n\t./json.lua:78: in function <./json.lua:44>\n\t(...tail calls...)\n\t./json.lua:78: in function <./json.lua:44>\n\t(...tail calls...)\n\t./json.lua:78: in function <./json.lua:44>\n\t(...tail calls...)\n\t./json.lua:78: in function <./json.lua:44>\n\t(...tail calls...)\n\t./json.lua:120: in function 'json.encode'\n\t./luaObjectToJson.lua:26: in main chunk\n\t[C]: in ?\n"
      }
    },
    "stack": "Error: Failed at requesting data.\n    at Cache._getRequest.then.catch.err (/var/www/Wf/cache.js:164:29)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:182:7)",
    "full": {
      "error": {
        "error": "lua5.3: ./json.lua:94: unexpected number value '-inf'\nstack traceback:\n\t[C]: in function 'error'\n\t./json.lua:94: in function <./json.lua:91>\n\t(...tail calls...)\n\t./json.lua:78: in function <./json.lua:44>\n\t(...tail calls...)\n\t./json.lua:78: in function <./json.lua:44>\n\t(...tail calls...)\n\t./json.lua:78: in function <./json.lua:44>\n\t(...tail calls...)\n\t./json.lua:78: in function <./json.lua:44>\n\t(...tail calls...)\n\t./json.lua:120: in function 'json.encode'\n\t./luaObjectToJson.lua:26: in main chunk\n\t[C]: in ?\n"
      }
    }
  }
}

Failing to request data

All url links respond with error 500.

{
  "error": {
    "message": "Failed at requesting data.",
    "data": {},
    "inner": {
      "message": "Failed to parse or find revisions.",
      "data": {},
      "inner": {},
      "stack": "Error: Failed to parse or find revisions.\n    at IncomingMessage.res.on (/var/www/Wf/cache.js:113:27)\n    at IncomingMessage.emit (events.js:185:15)\n    at endReadableNT (_stream_readable.js:1106:12)\n    at process._tickCallback (internal/process/next_tick.js:178:19)",
      "full": {
        "error": {}
      }
    },
    "stack": "Error: Failed at requesting data.\n    at Cache._getRequest.then.catch.err (/var/www/Wf/cache.js:164:29)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:182:7)",
    "full": {
      "error": {
        "error": {}
      }
    }
  }
}

Failing to request data on /void-wiki and /warframesConclave-wiki

Hi Snekw!
Can you look at these errors again?
Thank you for your support!

void-wiki

{
   "error":{
      "message":"Failed at requesting data.",
      "data":{
         
      },
      "inner":{
         "message":"Failed to get lua data.",
         "data":{
            
         },
         "inner":{
            
         },
         "stack":"Error: Failed to get lua data.\n    at getLuaObject.then.catch.err (/var/www/Wf/cache.js:110:31)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:182:7)",
         "full":{
            "error":"lua5.3: [string \"...\"]:13: module 'Module:Table' not found:\n\tno field package.preload['Module:Table']\n\tno file '/usr/local/share/lua/5.3/Module:Table.lua'\n\tno file '/usr/local/share/lua/5.3/Module:Table/init.lua'\n\tno file '/usr/local/lib/lua/5.3/Module:Table.lua'\n\tno file '/usr/local/lib/lua/5.3/Module:Table/init.lua'\n\tno file '/usr/share/lua/5.3/Module:Table.lua'\n\tno file '/usr/share/lua/5.3/Module:Table/init.lua'\n\tno file './Module:Table.lua'\n\tno file './Module:Table/init.lua'\n\tno file '/usr/local/lib/lua/5.3/Module:Table.so'\n\tno file '/usr/lib/x86_64-linux-gnu/lua/5.3/Module:Table.so'\n\tno file '/usr/lib/lua/5.3/Module:Table.so'\n\tno file '/usr/local/lib/lua/5.3/loadall.so'\n\tno file './Module:Table.so'\nstack traceback:\n\t[C]: in function 'require'\n\t[string \"...\"]:13: in local 'f'\n\t./luaObjectToJson.lua:25: in main chunk\n\t[C]: in ?\n"
         }
      },
      "stack":"Error: Failed at requesting data.\n    at Cache._getRequest.then.catch.err (/var/www/Wf/cache.js:164:29)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:182:7)",
      "full":{
         "error":{
            "error":"lua5.3: [string \"...\"]:13: module 'Module:Table' not found:\n\tno field package.preload['Module:Table']\n\tno file '/usr/local/share/lua/5.3/Module:Table.lua'\n\tno file '/usr/local/share/lua/5.3/Module:Table/init.lua'\n\tno file '/usr/local/lib/lua/5.3/Module:Table.lua'\n\tno file '/usr/local/lib/lua/5.3/Module:Table/init.lua'\n\tno file '/usr/share/lua/5.3/Module:Table.lua'\n\tno file '/usr/share/lua/5.3/Module:Table/init.lua'\n\tno file './Module:Table.lua'\n\tno file './Module:Table/init.lua'\n\tno file '/usr/local/lib/lua/5.3/Module:Table.so'\n\tno file '/usr/lib/x86_64-linux-gnu/lua/5.3/Module:Table.so'\n\tno file '/usr/lib/lua/5.3/Module:Table.so'\n\tno file '/usr/local/lib/lua/5.3/loadall.so'\n\tno file './Module:Table.so'\nstack traceback:\n\t[C]: in function 'require'\n\t[string \"...\"]:13: in local 'f'\n\t./luaObjectToJson.lua:25: in main chunk\n\t[C]: in ?\n"
         }
      }
   }
}

warframesConclave-wiki

{
   "error":{
      "message":"Failed at requesting data.",
      "data":{
         
      },
      "inner":{
         "message":"Failed to get lua data.",
         "data":{
            
         },
         "inner":{
            
         },
         "stack":"Error: Failed to get lua data.\n    at getLuaObject.then.catch.err (/var/www/Wf/cache.js:110:31)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:182:7)",
         "full":{
            "error":"lua5.3: [string \"local WarframeData = mw.loadData('Module:Warf...\"]:1: attempt to index a nil value (global 'mw')\nstack traceback:\n\t[string \"local WarframeData = mw.loadData('Module:Warf...\"]:1: in local 'f'\n\t./luaObjectToJson.lua:25: in main chunk\n\t[C]: in ?\n"
         }
      },
      "stack":"Error: Failed at requesting data.\n    at Cache._getRequest.then.catch.err (/var/www/Wf/cache.js:164:29)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:182:7)",
      "full":{
         "error":{
            "error":"lua5.3: [string \"local WarframeData = mw.loadData('Module:Warf...\"]:1: attempt to index a nil value (global 'mw')\nstack traceback:\n\t[string \"local WarframeData = mw.loadData('Module:Warf...\"]:1: in local 'f'\n\t./luaObjectToJson.lua:25: in main chunk\n\t[C]: in ?\n"
         }
      }
   }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.