Skip to content
TORNLIFE More

Torn API Libraries

Started by Nikkel [505692] on in API Development.

2 replies · 213 views · thread synced · 3 days ago · View on torn.com
About this thread

Posts archived: 3 / 3 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
3
Discussion span
→
People posting
1
Likes on archived posts
5
Authority score
51 / 100
Historical score
18 / 100
Story score
28 / 100
Engagement score
48 / 100
Nikkel [505692]
I've been developing a few private applications using Python and Javascript. I've partially created two libraries to make getting the data from torn easier. I was just wondering if there are any libraries already created that someone could share? If not, I don't mind working on developing several of them for different languages.

[UPDATE - 14/11/2020]
I've created an npm library that isn't complete yet. It has almost covered all the API endpoints apart from the market and torn. Timestamp features are not included yet and multiple chaining of selections. These will be added in upcoming updates along with easier more usable endpoints.

[UPDATE - 20/11/2020]
I have covered all endpoints including the item market. You simply have to provide an item ID to get a list of listing from both the bazaar and item market. I'll give an example below. The next update will be creating tests, documentation, and cleaning up the code. Might even add functionality for timestamps.
Latest Version 0.0.8

NPM URL - https://www.npmjs.com/package/torn-api

Installing
npm install torn-api
yarn add install torn-api

Usage
1. Import the package
import api from 'torn-api'; 


2. Set api key
api.key([TORN_API_KEY]); 


3. In an async function call the api

async () => {
console.log(await api.user.basic());
console.log(await api.faction.stats());
}


React Example (It was too difficult to add the code here so it's on gist)
https://gist.github.com/nikkel/cd0b8ee3cf24db0c5422a2db968be9f2