Query discord api from webiste - api

Is there a way to query the discord API without have a bot on a server.
I would like to retrieve my friends and my profile images and put it on a website I created.
I've done some research and only found stuff for discord bots.
Is what I want even possible ?

Yes, this is possible.
Take a look at this API route. You can just make a request there with the user id and get the whole user object.
If you need more information on the API itself and how to use it check out the Discord API Reference

Related

Using Instagram's Graph API, how can I retrieve post data (media url, caption, poster username, etc)

I want to use Instagram's Graph API on my backend server to retrieve data about an Instagram post. On my frontend, users will submit a post URL (like https://www.instagram.com/p/CAvPIm2lszQ/). Then on my backend, I want to take the ID of the post from that URL (so in this case CAvPIm2lszQ) and then I'm hoping that I can pass that ID thru the Instagram Graph API and then retrieve the data that I need (media URL, caption, poster username, etc.).
So would that be possible? I did find documentation on "IG Media" for the Graph API, but under permissions, it says, "A Facebook User access token from a User who created the IG Media object, with the following permissions.."
Unless I'm misunderstanding it, I'm not sure if I'll be able to access posts from various public accounts. I think it's also worth mentioning that my users are not logging into their Instagram accounts to use my service so the only possible "User access token" would be my own.
Any ideas on how I can go about this? I was using the instagram.com/p/{post_id}/?__a=1 endpoint to meet my needs before but it doesn't work on my production server for some reason. So I'm kinda stuck.
Most probably you will not be able to achieve that using Instagram API. First of all the ID you are referring to CAvPIm2lszQ is not the ID that you will use for getting IG Media. The ID is different (it's numeric value like in the sample request from the page you've linked). The full URL that includes CAvPIm2lszQ is in the shortcode field.
At the moment it is not possible to look for the post detail using shortcode. If you want to use that endpoint you need to get the real post ID first, for instance by listing list of posts from given user.
But in order to do so - you need to use Facebook login authorization window to get token from given user. Alternatively you can try to request https://developers.facebook.com/docs/instagram-api/guides/business-discovery but it requires going through App review and having your own company to pass the Business Verification. Keep in mind that this endpoint returns information only about Instagram Professional accounts (Business/Creator account). You will not be able to get information about regular accounts.
And the last thing about ?__a=1 endpoint. This is not the official Instagram API. They use it only for their own purposes. Most probably your server IP address has been blocked due to sending too many requests.

Apple Music API - How to get user identifier?

I am trying to retrieve the user's information after getting the Music Token from the Apple Music API. It seems that the /me endpoint is not available for queries other than the storefront (https://api.music.apple.com/v1/me/storefront).
Problem is, I need to identify each user with a unique ID, so I need to retrieve any good information to do that (for example, the email address could be a good starting point).
From the Apple Music API developer page, I can't find any endpoint to do so. Is there something I am missing?
Thank you :)
No, you're not missing anything. It's really frustrating that you can't get any user data from the api, because it probably means you'll have to also provide another sign-on method like Google or email/password to get information. Apple has just released its own SSO here, but I think the user would still have to authenticate that and MusicKit.

API to check Periscope User is Online

I've scoured for any information regarding an Open API for Periscope.
I have a twitter feed, that should only show if Periscope is Live (the said user will share the broadcast via Twitter).
I can parse the word "IS LIVE" but then I'd have to parse multiple languages.
I'm looking to check an API if the user is Online in periscope, if so, then display the latest twitter feed (which is the broadcast).
There was this User Online button that could be generated
https://www.periscope.tv/embed
it calls an api like https://embed.periscope.tv/user/bpsdmik.json
but it seems that the certificate is invalid, so I keep getting errors ..
Any help / workarounds would be much appreciated!
I've Searched OPEN Periscope, but mostly requires an Authentication token etc.
There is no open API for Periscope. At least, not that I'm aware of. Which would explain your difficulty in finding anything. The closest thing would be the Unofficial Periscope API, documented by Pmmlabs (the same folks who run the OpenPeriscope project). However, as you've already discovered, most of the calls to the Periscope API, including all user-related calls, require an auth token.
Outside of using the API or screen scraping, the only other way I can think of to tell if a user is live or not is to try accessing their Periscope page directly. When you go to a user's Periscope page at https://www.pscp.tv/{userId}, Periscope will redirect you to that users most recent broadcast, where you can parse the broadcast id from the redirect URL. Once you have the broadcast id of the most recent broadcast, you can use the following API call (which does not require an auth token):
https://api.periscope.tv/api/v2/getAccessPublic?token={broadcastId}
... to determine whether the broadcast is live or not. Look at the JSON response and if the "type" field equals "StreamTypeReplay", then it's a replay, otherwise it's a live broadcast.

Update user's page in the same way Facebook do

I am developing a web app for a little company. There, for example, we can have users A,B and C that are from a account team. We can have a users D,F,G,H that are form sales team.
Each user has his own private page, like Facebook and they are linked by team, that means in Facebook language, A is friend from B an C, not from D,F,G,H. So when B sends a new thought for the team the others team users (A,C) can see the message.
So my question is, lets say the user A is logged in at his page and user B send a message to the team, how to update the user A and C browser in the same way we see in facebook when we have new posts from our friends?
For the moment I could think about a script, trough AJAX, that could check in the database for the new posts from "myFriends" each 5seconds. But I dont think Facebook do this. Maybe Facebook use HTTP persistent conections http://en.wikipedia.org/wiki/HTTP_persistent_connection . I dont know.
In fact I dont know the best way (best practices) to achieve this results. Idont know even the tags I should use for this question.
Any thought?
Update: I am using php, AJAX, Bootsrap jQuery, MySQL
Estimated.
Whereas want similar functionality to Facebook, if you check the console (with Firebug in my case) you realize that always makes GET requests to the server, both for notifications to Chat. That is, do not use Http Persistent. You could use $.ajax() function of jQuery to make GET Requests, get a JSON and update the elements you want in your page.

Where is the api for retrieving user joined communities in Google+?

I'm creating a tool for a person to login into their google+ account and to lists all communities they were created or joined. I had googling around for a day and read google+ api references, but I couldn't find any information on:
Url of the API for accessing user's created or joined comminities,
Request parameters to perform such query
My tool has already succeed to perform oauth login and get access_token and ready to make any API call, But now I'm stuck trying to find the right Url and requirements to perform the API call as I wanted.
Please help
There currently is no API method to do this. If you would like to see such a feature added, you can star this feature request.