Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Twitter card from API

Tags:

twitter

I would be able to retrieve HTML markup of what is stored in Twitter Card (https://dev.twitter.com/docs/cards).

Up until now I used TweetSharp library to retrieve tweets from some user's timeline. But, what is not surprising, because cards are new thing, it is not included.

Does anyone know, if it is possible to access card (data cached by Twitter crawler) with API?

like image 896
Tschareck Avatar asked Jan 17 '14 14:01

Tschareck


People also ask

How do I get Started with the Twitter API?

So let’s get started. Wait, but what are the requirements? In order to begin using the Twitter API, you’ll need an account with Twitter that will get you access to an API Key (Consumer Key). Getting credentials to the Twitter API is really simple.

How do I make a Twitter app with Python?

Get access to the Twitter API To make any request to the Twitter API (in python or anywhere else) you require your API Key and Access Token. For this, you need to apply for a developer account with Twitter and have your account approved. Once approved, you can create a project and associate it with a sample App.

How do I Find my Twitter API keys and tokens?

If you need to find your access tokens and keys again, then in the left hand menu select Projects & Apps > your project name. You’ll see a page that will enable you to regenerate your keys and tokens if you have lost them. The Twitter api documentation describes these like this:

How to get Twitter API keys and authorization credentials?

This will allow you to access the Twitter developer portal. 2. Head over to the Twitter Dev Site and Create a New Application Navigate to apps.twitter.com, sign in, and create a new application. After that, fill out all the app details and… …Voila! You now should be able to access all the required API Keys and authorization credentials.


1 Answers

The Twitter cards themselves are not exposed through the Twitter API.

What you'll need to do is make a request to the URL mentioned and examine the <head> element to see if they have the Twitter Card info in there.

like image 135
Terence Eden Avatar answered Oct 11 '22 17:10

Terence Eden