I am having an issue in getting the data from LinkedIn API , I have got the permissions and trying postman to test endpoint to get data mention below is my get request , every time the response is an empty elements list with 200 ok. any help in this regard will be highly appreciated. I am sure that their is data its not that there is no activity but cant retrieve via api request.
https://api.linkedin.com/v2/adAnalyticsV2?q=analytics&dateRange.start.year=2019&dateRange.start.month=5&dateRange.start.day=28&dateRange.end.year=2021&dateRange.end.month=9&dateRange.end.day=30&timeGranularity=DAILY&pivot=MEMBER_COMPANY&projection=(*,elements*(externalWebsiteConversions,dateRange(*),impressions,landingPageClicks,likes,shares,costInLocalCurrency,pivot,pivotValue~(localizedName)))&fields=externalWebsiteConversions,dateRange,impressions,landingPageClicks,likes,shares,costInLocalCurrency,pivot,pivotValue&accounts[0]=urn:li:sponsoredAccount:123456789
and this is the response every time
{
"paging": {
"count": 10,
"start": 0,
"links": []
},
"elements": []
}
Related
I'm having trouble looping a group of requests on the "Full Archive Search" on Twitter API v2.
I need to get all the responses from a determined subject, but there is a limit of tweets per page. To cover this, a "next_token" is generated on the body response. I need to make lots of requests using the "next_token" as a parameter to the subsequent request.
The thing is, I have no idea how can i make a loop, and collect all the responses.
There are more than 500.000 tweets in the period that I am searching for. And the limit of tweets per page is 500.
I'm using the default request from the "Full Archive Search", on Twitter API, using "query", "start_time" and "end_time"
The response that I got has a limit of tweets per page. At the bottom of each page, have the following lines:
"meta": {
"newest_id": "1321965025809059840",
"oldest_id": "1321964960956768256",
"result_count": 8,
**"next_token": "b26v89c19zqg8o3fosbski4ttnan7ven9iyr8gbrdfiwt"**}
I need to get that "next_token" and add it to the subsequent request.
Does anyone have an idea how can i collect all this data?
Edit: I tried to use the code below to get the "next_token":
pm.test("Set Next Token", function () {
var jsonData = pm.response.json();
console.log(jsonData.next_token)
pm.collectionVariables.set("next_token", jsonData.next_token);
});
But it returns to this error:
{
"errors": [
{
"parameters": {
"next_token": [
"null"
]
},
"message": "Invalid 'next_token':'null'."
}
],
"title": "Invalid Request",
"detail": "One or more parameters to your request was invalid.",
"type": "https://api.twitter.com/2/problems/invalid-request"
}
I’ve been creating a web app with a login and a registration function and so far everything has been going great. I managed to connect the app to the api/auth/local api endpoint and send some nice post requests.
Now, I’ve been trying to send requests to the http://localhost:1337/api/auth/local/register endpoint and without any success. I’ve been doing this according to:
https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html#registration
I keep getting a 400 error:
{
"data": null,
"error": {
"status": 400,
"name": "ApplicationError",
"message": "An error occurred during account creation",
"details": {
}
}
}
If I try to send a request with an email that’s already registered in strapi, the response will give me the correct error:
{
"data": null,
"error": {
"status": 400,
"name": "ApplicationError",
"message": "Email is already taken",
"details": {
}
}
}
In the public and authenticated user roles, I’ve allowed every single one of them, for now.
Enable confirmation emails are set to false.
Email confirmation
Public user permission
For the headers, I’m using Content-type : application/json
the raw json body I'm posting:
{
"email": "manager1#strapi.io",
"password": "testtest1",
"username": "manager1"
}
This is my first project with strapi and so far it went pretty well. I’m not sure if I’m missing out on something or if I’m doing something else wrong.
Any help is appreciated!
I figured it out, it wasn’t as complicated as I expected.
In the user I had different fields, like firstName, lastName etc. All of these fields were required.
I made the fields not required, and now it works.
The question is about kucoin websocket public channel (not trades) just last trades
I just want a live feed of trades like other crypto exchanges...
but when I want to connect to "wss://ws-api-futures.kucoin.com/endpoint" I get WebSocketError: Received unexpected status code (401 Unauthorized)
the documentation https://docs.kucoin.com/futures/#create-connection lack explications :(
normally with other exchanges I can just do this in javascript
bybit_market_ws = new WebSocket("wss://stream.bybit.com/spot/quote/ws/v2");
bybit_market_ws.onmessage = event => bybit_trades(event.data);
bybit_market_ws.onopen = event => bybit_market_ws.send(JSON.stringify({"topic":"trade","params":{"symbol":"BTCUSDT","binary":false},"event":"sub"}));
function bybit_trades (jsonx) { console.log(JSON.parse(jsonx)); }
so how can I do that with kucoin websocket ?
according to the documentation i would need a "public token"...
but there is no explication on how to get that token :(
does someone knows how I would retrieve the last trades via websocket (public) channel ?
Note that the following steps may be changed when the API is updated.
All information can be found at https://docs.kucoin.com/#apply-connect-token
Get the public token
Send a empty http POST (GET will not work) message to https://api.kucoin.com/api/v1/bullet-public.
Response:
{
"code": "200000",
"data": {
"token": "2neAiuYvAU61ZD...",
"instanceServers": [
{
"endpoint": "wss://ws-api.kucoin.com/endpoint",
"encrypt": true,
"protocol": "websocket",
"pingInterval": 18000,
"pingTimeout": 10000
}
]
}
}
Connect to the Websocket
With the data of the repsonse above:
websocket: endpoint + "?token=" + token
Example: wss://ws-api.kucoin.com/endpoint?token=2neAiu....
Get all supported trading pairs
send a http GET message to https://api.kucoin.com/api/v1/symbols
{
"code": "200000",
"data": [
{
"symbol": "REQ-ETH",
"name": "REQ-ETH",
"baseCurrency": "REQ",
"quoteCurrency": "ETH",
...
},
{
"symbol": "BTC-USDC",
"name": "BTC-USDC",
"baseCurrency": "BTC",
"quoteCurrency": "USDC",
...
},
...
Get trading data
When the websocket connection is established send a http POST message:
{
"type": "subscribe", //subscribe or unsubscribe
"topic": "/market/ticker:BTC-USDT,BTC-USDC"
}
maybe this answer will not please you at all, but i will try, most of the people who work from the API in KuCoin do it with python, in fact the SDK for Nodejs is out of date, your best bet is to ask in the telegram channel https://t.me/KuCoin_API, there are KuCoin engineers who always help, although most of them use python, there is also the academy channel https://t.me/kucoin_learning, where there are examples, in short I can only mention references because I was also where you are, and the best I could do was that and review the SDk code and from there intuit and create my own adjustments
PD: the datafeed.js file is your best option, check it out https://github.com/Kucoin/kucoin-futures-node-sdk/blob/master/src/lib/datafeed.js
Re-posting from a direct API support contact.
I would like to know how many days of data can I get access to per API call? If limited, how far can we go back in time?
Are you limiting the number of API calls.
I know you don't allow storing data on my side, that's why I would like to query every data in one time to analyze it.
Each endpoint has it's own methods and parameters for retrieving data over time, but in general, the UP API does not place limits on the amount of data you can request in a single call.
If the amount of data you have requested exceeds a certain limit, the API response will automatically page the requested data and provide you with a next URL that you can use to retrieve the next page of data.
The only limitation is how much historical data a particular UP user has.
Here's an example request/response from the moves endpoint.
Request
GET https://jawbone.com/nudge/api/v.1.1/users/#me/moves?start_time=1383289200 HTTP/1.1
Host: jawbone.com
Response
(Scroll to the bottom to see the next link)
HTTP 200 OK
{
“meta”:
{
“user_xid”: “6xl39CsoVp2KirfHwVq_Fx”,
“message”: “OK”,
“code”: 200
"time": 1386122022
},
“data”:
{
"items":
[{
"xid": "40F7_htRRnQwoMjIFucJ2g",
"title": "16,804 steps",
"type": "move",
"time_created": 1384963500,
"time_updated": 1385049599,
"time_completed": 1385099220,
"date": 20131121
"snapshot_image": "/nudge/image/e/1385107737/40F7_htRRnQwoMjIFucJ2g/grEGutn_XYZ.png"
"details":
{
"distance": 14745,
"km": 14.745,
"steps": 16804,
"active_time": 11927,
"longest_active": 2516,
"inactive_time": 32760,
"longest_idle": 27180,
"calories": 1760.30480012,
"bmr_day": 1697.47946931,
"bmr": 1697.47946931,
"bg_calories": 1099.9439497,
"wo_calories": 388.506116077,
"wo_time": 11484,
"wo_active_time": 3902,
"wo_count": 2,
"wo_longest": 2516,
"sunrise": 1409578680,
"sunset": 1409625420,
"tz": "America/Los Angeles",
"tzs":
[
[1384963500, "America/Phoenix"],
[1385055720, "America/Los_Angeles"]
],
"hourly_totals":
{
"2013112101":
{
"distance": 1324,
"calories": 90.0120018125,
"steps": 1603,
"active_time": 793,
"inactive_time": 220,
"longest_active_time": 302,
"longest_idle_time": 780
},
"2013112101":
{
"distance": 626,
"calories": 47.0120018125,
"steps": 455,
"active_time": 246,
"inactive_time": 260,
"longest_active_time": 203,
"longest_idle_time": 650
},
... more hours ...
}
}
},
{
... more items ....
}],
"links":
{
"next": "/nudge/api/v.1.1/users/6xl39CsoVp2KirfHwVq_Fx/moves?page_token=1384390680"
},
“size”: 10
}
}
The UP API will not limit the number of calls you can make. However, the API does have Rate Limiting, which could keep you from issuing a large amount of requests over a short period of time. Here's the details from the FAQ:
What is the rate limit for your API?
The API includes very high rate-limiting safety valves that should be
more than enough for the standard application. If you find that your
application is exceeding these limits, please let us know your
intended use and call volume, so we can review the provisions.
And finally, there is no rule preventing you from storing data that you have retrieved from the API. The only requirement is that you comply with the privacy and data removal policies outlined in the UP API terms.
I am trying to extract the banner-image used in a certain youtube channel programmatically.
As far as I know it is to be in the brandingSettings, to be exact I think it is brandingSettings.image.bannerImageUrl, see here for an indetail description of the API:
https://developers.google.com/youtube/v3/docs/channels
So, I suppose I should be able to get that information with a GET request like this:
https://www.googleapis.com/youtube/v3/channels?part=brandingSettings&key=[YOURAPIKEY]&forUsername=esltv
But that request (replacing the [YOURAPIKEY] with my actual key of course) returns without the desired part "brandingSettings":
{
"kind": "youtube#channelListResponse",
"etag": "\"79S54kzisD_9SOTfQLu_0TVQSpY/WJfuNLYVgEQVEhWQ-03PpQlCyzo\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 5
},
"items": [
{
"kind": "youtube#channel",
"etag": "\"79S54kzisD_9SOTfQLu_0TVQSpY/GwL7oIruOCBr66yiNtrJqE3_Drs\"",
"id": "UC0G2qz-hoaCswQNgoWU_LTw"
}
]
}
I currently have turned on "YouTube Data API v3" in google api console.
Am I missing some permission, or does the channel somehow not suit in regard of retrieving its brandingSettings?
BRs,
Sebastian
for Username is actually for you to get the channelId. channels.list actually depends on channelId.
So with your first request you get channelID back, then do the same request second time, use channelId instead of username. (If you already know channelID use it first time as well.)
GET https://www.googleapis.com/youtube/v3/channels?part=brandingSettings&id=UC0G2qz-hoaCswQNgoWU_LTw&key={YOUR_API_KEY}