-1

I had an idea for an app where I need to fetch some data from websites. To give you an example of what I mean: Youtube counts subscribers. Can you fetch that data somehow and transfer it into your app. (not using the api now, just an example). Is that in anyway posible?

Sincerly, THA

JuJoDi
  • 14,627
  • 23
  • 80
  • 126
  • 2
    You could scrape it off the page, but then any time YouTube make a breaking change on the page, all your stuff falls over, that's why they did an API – Tony Hopkinson Aug 22 '13 at 12:40

1 Answers1

0

Considering that the information is on a public webpage, you can retrieve it (by looking in the source code of the page with a kind of XML parser for instance).

But what is sure is that using an API would be a more efficient and sustainable way to do it...

And for information, using XCode has nothing to do with your question. The important thing is the language you use.

julienc
  • 19,087
  • 17
  • 82
  • 82
  • Thanks for your awnser. Using the Google API would be an option, but the information I want to have is not available in their API. With chrome I can inspect the page and retrieve information, but what am I looking for to be able to use it? To go on with my example it would be span.about-stat-value. – Paul Werker Aug 22 '13 at 12:53
  • I am pretty sure the Youtube API allows this, check this (`subscriberCount`): https://developers.google.com/youtube/2.0/developers_guide_protocol_profiles Otherwise, for iOS, look for `NSURLRequest`. – julienc Aug 22 '13 at 12:55
  • Wow, how did you find that!? Thanks! I am pretty sure this will work :) EDIT: This is v2 Youtube API, I thought that one was no longer usable? – Paul Werker Aug 22 '13 at 13:01