A
A
Andrew2019-10-11 18:27:58
PHP
Andrew, 2019-10-11 18:27:58

Where to get instagram photo id from carousel post?

The instagram API returns a carousel in the format:

instagram API response

[carousel_media] => Array
                        (
                            [0] => Array
                                (
                                    [images] => Array
                                        (
                                            [thumbnail] => Array
                                                (
                                                    [width] => 150
                                                    [height] => 150
                                                    [url] => https://scontent.cdninstagram.com/vp/4330f6dc5600d268961ad10183aff832/5E3797CF/t51.2885-15/e35/c90.0.900.900a/s150x150/69356048_144987753387604_8752307700567114337_n.jpg?_nc_ht=scontent.cdninstagram.com
                                                )

                                            [low_resolution] => Array
                                                (
                                                    [width] => 320
                                                    [height] => 266
                                                    [url] => https://scontent.cdninstagram.com/vp/2b8e3e51c178b2c79667b6bf702d5d5d/5E221A1F/t51.2885-15/e35/s320x320/69356048_144987753387604_8752307700567114337_n.jpg?_nc_ht=scontent.cdninstagram.com
                                                )

                                            [standard_resolution] => Array
                                                (
                                                    [width] => 640
                                                    [height] => 533
                                                    [url] => https://scontent.cdninstagram.com/vp/30100017b4162c9db9c8b5fe2f76cff6/5DFFA348/t51.2885-15/sh0.08/e35/s640x640/69356048_144987753387604_8752307700567114337_n.jpg?_nc_ht=scontent.cdninstagram.com
                                                )

                                        )

                                    [users_in_photo] => Array
                                        (
                                        )

                                    [type] => image
                                )


But, for example, photos from the archive come with the following names:
0aa6312f4946b37d9203026b7cc6ccea.jpg
0e61754a4f4b699c6017d2b0ba89cbcd.jpg
0ebaf9081b58382476e0790d0d800627.jpg
Where can I get this id from?
You need to save the pictures in your database. While I take the last big number from the url, for example: 8752307700567114337

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question