Library to get og:image with sample project. The URL of og:image is got from regular expression finding with whole HTML. The character encoding must be set to proper one.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Objective-C Library to get og:image


  1. import library files: NSURL+OgImage.h/m
  2. import library files: NSString+Encode.h/m
  3. write code like below:


NSData *d = [NSData dataWithContentsOfURL:[NSURL ogImageURLWithURL:url]];
imageView.image = [UIImage imageWithData:d];

Sample project

A project with one text field and one image view. When you enter the URL, the og:image of the web page will be shown.

For example, in the below screenshot, the URL is

Screen Shot


This library is under MIT licence.