Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get all photos from Instagram which have a specific hashtag with PHP [closed]

I need to get some pictures which have a specific hashtag using PHP ? Any help will be awesome, or hint ?

like image 762
Zeid Selimovic Avatar asked Jun 25 '12 00:06

Zeid Selimovic


People also ask

How do I see all posts under a hashtag?

Hashtag pages have an Instagram Story icon in the top left corner. Click on it and you'll see a collection of Stories posts tagged with the hashtag from people with public profiles.

How can I get Instagram photos in PHP?

Let's get started, first you will need to register your application on the Instagram dev site and obtain your Client ID. Set the callback url to localhost or whatever(not important, you will see why below). Now let's obtain the access token. Grant the application access to your images and press OK.

How do you get all hashtags on Instagram with API?

The Hashtag Search API consists of the following nodes and edges: GET /ig_hashtag_search — to get a specific hashtag's node ID. GET /{ig-hashtag-id} — to get data about a hashtag. GET /{ig-hashtag-id}/top_media — to get the most popular photos and videos that have a specific hashtag.

Is it possible to search Instagram hashtags and filter it by locations?

Instagram app for Android and iPhoneTap at the bottom to go to Search & Explore. Tap Search in the search bar at the top. Type the location name, then tap the search button in the bottom right of your keyboard. Tap Places below the search bar to see a list of locations that match your search.


1 Answers

Here's another example I wrote a while ago:

<?php            // Get class for Instagram     // More examples here: https://github.com/cosenary/Instagram-PHP-API     require_once 'instagram.class.php';      // Initialize class with client_id     // Register at http://instagram.com/developer/ and replace client_id with your own     $instagram = new Instagram('CLIENT_ID_HERE');      // Set keyword for #hashtag     $tag = 'KEYWORD HERE';      // Get latest photos according to #hashtag keyword     $media = $instagram->getTagMedia($tag);      // Set number of photos to show     $limit = 5;      // Set height and width for photos     $size = '100';      // Show results     // Using for loop will cause error if there are less photos than the limit     foreach(array_slice($media->data, 0, $limit) as $data)     {         // Show photo         echo '<p><img src="'.$data->images->thumbnail->url.'" height="'.$size.'" width="'.$size.'" alt="SOME TEXT HERE"></p>';     } ?> 
like image 131
kexxcream Avatar answered Sep 16 '22 11:09

kexxcream