wss://api.upstox.com/v2/feed/market-data-feed?guid=someguid&method=sub&data={mode: full,instrumentKeys: [NSE_INDEX|Nifty Bank]}
iam testing in postman it is connected but no response iam not understanding what is Get Portfolio Stream Feed Authorized url
Postman is not recommended for WebSocket implementation. Please refer to the Python SDK for WebSocket implementation: Upstox Python SDK. Instructions are included in the README file.
For details, see the MarketDataStreamer section: MarketDataStreamer.
Node.js, Java, and PHP SDKs are also available: Upstox SDKs.
ok. can you guide me i dont know how integrate it.
hello Pradeep jaiswar sir. i need help to use php sdk. actually i am using PHP SDK. for websocket.i have updated access_token. but when i try to access file. it gives me 500 error.
https://softechnology.in/examples/websocket/market_data/websocket_client.php
please help me .
@Pradeep_Jaiswar sir
Please help @Ketan sir
- Install composer which is used for package management in php. Composer
- Open a empty folder and run the following command
composer require upstox/upstox-php-sdk
. - In the same directory create a new php file with any name of your choice, lets say
market_feeder.php
and paste the following code.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
use Upstox\Client\Configuration;
use Upstox\Client\Feeder\MarketDataStreamer;
use Revolt\EventLoop;
use function Amp\async;
use function Amp\delay;
$config = Configuration::getDefaultConfiguration()->setAccessToken('{your_access_token}');
$streamer = new MarketDataStreamer($config, ["MCX_FO|426302", "NSE_EQ|INE528G01035"], "full");
function on_open($streamer)
{
print("on_open function called");
}
function on_message($streamer,$data)
{
print("on_message= " . ($data) . "\n");
}
function error($streamer, $data)
{
print("on_error= " . ($data) . "\n");
}
function close($streamer, $code, $message)
{
print("on_close= " . ($code) . $message . "\n");
}
$streamer->autoReconnect(false);
$streamer->on("open", 'on_open');
$streamer->on("message", 'on_message');
$streamer->on("error", 'error');
$streamer->on("close", 'close');
$streamer->connect();
print("POST CONNECT");
EventLoop::run();
You would be able to get market feed on your local.
For more information please refer github documentation → Upstox PHP
hello sir,
i follow steps as you mentioned . but still it giving 524 error. please
i want to integrate just by using websocket end points, not with sdk al because i dont have any guidence on that and your replaying every day once if any error where i need to check it.
i have used postman for other websocket testing it was working fine but why not for ur websocket?
it is connected in have send data in params but also iam getting no data in return