Observed since 20 Oct, 20:38 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
5paisajs
Javascript client for 5paisa APIs natively written in .NET
Official Javascript client for 5paisa APIs natively written in .NET
npm install 5paisajs --save
Docs are hosted at https://5paisa.github.io/5paisa-js/
Get your API keys from (https://tradestation.5paisa.com/apidoc)
// Configuration for your app
const conf = {
appSource: "",
appName: "",
userId: "",
password: "",
userKey: "",
encryptionKey: "",
clientCode: "",
};
const { FivePaisaClient } = require("5paisajs");
var client = new FivePaisaClient(conf);
// This client object can be used to login multiple users.
client
.get_TOTP_Session("Client code", "TOTP", "PIN")
.then((response) => {
// Fetch holdings, positions or place orders here.
// Some things to try out are given below.
})
.catch((err) => {
// Oh no :/
console.log(err);
});
Get your API keys from (https://tradestation.5paisa.com/apidoc)
// Configuration for your app
const conf = {
appSource: "",
appName: "",
userId: "",
password: "",
userKey: "",
encryptionKey: "",
clientCode: "",
};
const { FivePaisaClient } = require("5paisajs");
var client = new FivePaisaClient(conf);
// This client object can be used to login multiple users.
const access_token = "";
client
.set_access_token(access_token)
.then((res) => {
// Fetch holdings, positions or place orders here.
// Some things to try out are given below.
})
.catch((err) => {
// Oh no :/
console.log(err);
});
Get your API keys from (https://tradestation.5paisa.com/apidoc)
First get a token by logging in to -> https://dev-openapi.5paisa.com/WebVendorLogin/VLogin/Index?VendorKey=&ResponseURL=
VendorKey is UesrKey for individuals user
for e.g. you can use ResponseURL as https://www.5paisa.com/technology/developer-apis Pass the token received in the response url after successful login to get an access token (this also sets the token for all the APIs you use)- Please note that you need to copy the request token from URL and paste in this code and start the code within 30s.
client.get_oauth_session('Your Request Token')
After successful authentication, you should get a Logged in!! message in console
// Configuration for your app
const conf = {
appSource: "",
appName: "",
userId: "",
password: "",
userKey: "",
encryptionKey: "",
clientCode: "",
};
const { FivePaisaClient } = require("5paisajs");
var client = new FivePaisaClient(conf);
// This client object can be used to login multiple users.
const request_token = "";
client
.get_oauth_session(request_token)
.then((res) => {
// Fetch holdings, positions or place orders here.
// Some things to try out are given below.
})
.catch((err) => {
// Oh no :/
console.log(err);
});
client
.getHoldings()
.then((holdings) => {
console.log(holdings);
})
.catch((err) => {
console.log(err);
});
/*
[
{
BseCode: 535755,
CurrentPrice: 140,
DPQty: 0,
Exch: '\x00',
ExchType: 'C',
FullName: 'XYZ ABC',
NseCode: 30108,
POASigned: 'N',
PoolQty: 1,
Quantity: 1,
ScripMultiplier: 1,
Symbol: 'XYZ'
}
]
*/
client
.getPositions()
.then((positions) => {
console.log(positions);
})
.catch((err) => {
console.log(err);
});
var options = {
exchangeSegment: "C",
atMarket: false,
stopLossPrice: 0,
isVTD: false,
isIOCOrder: false,
isIntraday: false,
ahPlaced: "N",
IOCOrder: false,
price: 208,
};
try {
client.placeOrder("BUY", "1660", "1", "N", options).then((response) => {
console.log(response);
});
} catch (err) {
console.log(err);
}
client.modifyOrder("1100000007628729", "1", "210", "1660", false, "N", "C", true).then((response) => {
console.log(response)
})
} ).catch((err) => {
console.log(err)
});
client.cancelOrder("1100000007973827", "1", "205", "1660", false, "N", "C", false).then((response) => {
console.log(response)
})
} ).catch((err) => {
console.log(err)
});
var a = {};
client
.bocoorder(1660, 1, 205, 0, 217, "B", "N", "C", "P", 200, a)
.then((Response) => {
console.log(Response);
})
.catch((err) => {
console.log(err);
});
// Note : For Cover order par Order_for='c'
var a = {
ExchOrderId: "1100000008193800",
};
client
.bocoorder(1660, 1, 205, 0, 217, "B", "N", "C", "M", 200, a)
.then((Response) => {
console.log(Response);
})
.catch((err) => {
console.log(err);
});
// Note : We Can not Modify Target And Stoploss legs
var ab = {
price: 215,
};
client
.Mod_bo_order("S", 1660, 1, "N", "1100000008697274", ab)
.then((Response) => {
console.log(Response);
})
.catch((err) => {
console.log(err);
});
// Note : This is for modify profit order.
var ab = {
isStopLossOrder: true,
stopLossPrice: 205,
isIntraday: true,
atMarket: true,
};
client
.Mod_bo_order("S", 1660, 1, "N", "1100000008697274", ab)
.then((Response) => {
console.log(Response);
})
.catch((err) => {
console.log(err);
});
// Note : this is for modify stoploss order.
a = [
{
Exch: "N",
ExchType: "D",
Symbol: "NIFTY 27 MAY 2021 CE 14500.00",
Expiry: "20210527",
StrikePrice: "14500",
OptionType: "CE",
},
];
client
.getMarketFeed(a)
.then((response) => {
console.log(response);
})
.catch((err) => {
console.log(err);
});
a = [
{
Exch: "N",
ExchType: "C",
ScripCode: "0",
ScripData: "RELIANCE_EQ",
},
{
Exch: "N",
ExchType: "D",
ScripCode: "40354",
ScripData: "",
},
];
client
.fetch_market_feed_by_scrip(a)
.then((response) => {
console.log(response);
})
.catch((err) => {
console.log(err);
});
orderList = [
{
Exch: "N",
RemoteOrderID: "1000000002817035",
},
{
Exch: "N",
RemoteOrderID: "23060806720092",
},
];
client
.getOrderStatus(orderList)
.then((response) => {
console.log(response);
})
.catch((err) => {
console.log(err);
});
a = [
{ Exchange: "N", ExchangeType: "D", ScripCode: "51440" },
{ Exchange: "N", ExchangeType: "C", ScripCode: "1660" },
];
client
.getmarketdepth(a)
.then((response) => {
console.log(response);
})
.catch((err) => {
console.log(err);
});
// historicalData(<Exchange>,<Exchange Type>,<Scrip Code>,<Time Frame>,<From Data>,<To Date>)
a = client.historicalData("n", "c", "1660", "1m", "2021-05-31", "2021-06-01");
//Note: Timeframe should be from this list ['1m','5m','10m','15m','30m','60m','1d']
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
axiosEnvironment{
"local_name": "axios",
"alias": false,
"peer_metadata": null
} | ^0.19.2 | runtime |
axios-cookiejar-supportEnvironment{
"local_name": "axios-cookiejar-support",
"alias": false,
"peer_metadata": null
} | ^1.0.0 | runtime |
tough-cookieEnvironment{
"local_name": "tough-cookie",
"alias": false,
"peer_metadata": null
} | ^4.0.0 | runtime |
axiosEnvironment{
"local_name": "axios",
"alias": false,
"peer_metadata": null
} | ^0.19.2 | development |
axios-cookiejar-supportEnvironment{
"local_name": "axios-cookiejar-support",
"alias": false,
"peer_metadata": null
} | ^1.0.0 | development |
tough-cookieEnvironment{
"local_name": "tough-cookie",
"alias": false,
"peer_metadata": null
} | ^4.0.0 | development |
eslintEnvironment{
"local_name": "eslint",
"alias": false,
"peer_metadata": null
} | ^4.11.0 | development |
eslint-config-conciseEnvironment{
"local_name": "eslint-config-concise",
"alias": false,
"peer_metadata": null
} | ^0.15.0 | development |
eslint-config-concise-jestEnvironment{
"local_name": "eslint-config-concise-jest",
"alias": false,
"peer_metadata": null
} | ^0.15.0 | development |
huskyEnvironment{
"local_name": "husky",
"alias": false,
"peer_metadata": null
} | ^0.14.3 | development |
jestEnvironment{
"local_name": "jest",
"alias": false,
"peer_metadata": null
} | ^21.2.1 | development |
lint-stagedEnvironment{
"local_name": "lint-staged",
"alias": false,
"peer_metadata": null
} | ^5.0.0 | development |
npm-run-allEnvironment{
"local_name": "npm-run-all",
"alias": false,
"peer_metadata": null
} | ^4.1.2 | development |
prettier-eslint-cliEnvironment{
"local_name": "prettier-eslint-cli",
"alias": false,
"peer_metadata": null
} | ^4.4.0 | development |
Source distribution
{
"integrity": "sha512-4VnKMo5wH090oucXG04Yf3YZxnk1ObGOiM8vK5tj4qsAbj42L9sXaR5acrQw5vM5p0JLTf3lIMl/ipdMfTIHXA==",
"shasum": "72a289d7b298f17c2f653d9ba8b5e584d2b622ef",
"tarball": "https://registry.npmjs.org/5paisajs/-/5paisajs-0.0.1.tgz",
"fileCount": 3,
"unpackedSize": 10199,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfH+dtCRA9TVsSAnZWagAAdQ0P/RZ2NuIxZVLxYrtT31PK\nlSh6OgkwSDSe+7LxEvOp/49wEQwQVdfiJ1a/saj9NUGvBELF9r2hEaGk+BNv\nMRE37o07ToEybzi84PcFhj68fN4d8K1ctn0EFqB6S51cmJhtor4t4RI52QMg\nBUiSVIRRYKXiQ0pyw2acKF19wFE35DLHxx/Lmy2gfip+f7oPEbFjATFYo1Rr\nmSNcSE7O66ooxsuN7/s/SkLKgazYepDoPLichIGKqrUdRrpnqzKS6DHOVXzD\nurHCA+A1tD1vj0PDw0IltBl9h6lp1m/8Z2gpDP0hPE2Yed/Sjb8xQ4CMiUCd\nFBqTU1Dxy1xLHx+8I9xBagQKMzg4aPpaVRQaLPgwa5Cs/ZGqOhytsazHfk7W\nyuRY18f3IsnUhHqDGLyfmFg8dkaf9G/quHJqyCPwInbaXp726BLOFU+R5kjX\n1FZeHhcSVlRYNXnoU5UvzMVgzb1mcyTfEkol+60cejA5cTbYr00i+UHWkGUG\nIdyVCk3TPDOCCEcLeR8QVx3HKq0fXmcbDHuUS4KW4YhA5VIv9uYNidzZC5jX\nPw0h9huKEmCDIOoWZaGW6Lhj8ERzAGFxWWXMYIVta9yu6AtUpr9hgPa+/xFn\nVqW0oW9gLvT0HnDaYpNQjBZumZBhQ7Un0z3Y4F0NNDaBKKo21H92lsNRQT07\nUdNa\r\n=KhGs\r\n-----END PGP SIGNATURE-----\r\n",
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEYCIQD5GiF4XW4N/uZbsu0gypsieJ8bN54g9rMfTcGlTovQuAIhALeifuMwlngBjDjJDQhhR33MIh43+g9zQGYOs/+hbjHX"
}
]
}Observed since 20 Oct, 20:38 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:47d0d3900402be486e1c72d620032e137efb975c3c768ef5dbe7bce5bbb98dce