Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit f95e6e3

Browse files
committed
Fixed API rate limiting error
This closes #78 and #79
1 parent 0a94032 commit f95e6e3

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## 9.0.1 (released 2018-06-12)
4+
5+
- Fixed API rate limiting error
6+
37
## 9.0.0 (released 2018-06-01)
48

59
- Added user information endpoint

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ $instagram->self();
6464

6565
> **Note:** You can only fetch a user's recent media from the given access token.
6666
67+
## Rate Limiting
68+
69+
The Instagram allows you to call their API 200 times per hour. Try to cache the responses in your application.
70+
71+
> _The Instagram API uses the same rate limiting as the Graph API (200 calls per user per hour) with one exception: the /media/comments edge limits writes to 60 writes per user per hour. Please refer to the Graph API's rate limiting documentation for more information_ - [Facebook](https://developers.facebook.com/docs/instagram-api/overview/#rate-limiting)
72+
6773
## License
6874

6975
[MIT](LICENSE) © [Vincent Klaiber](https://vinkla.com)

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
"extra": {
3737
"branch-alias": {
38-
"dev-develop": "9.0-dev"
38+
"dev-develop": "9.1-dev"
3939
}
4040
},
4141
"minimum-stability": "dev",

src/Instagram.php

+4
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ protected function get(string $path): object
111111

112112
$body = json_decode((string) $response->getBody());
113113

114+
if (isset($body->error_message)) {
115+
throw new InstagramException($body->error_message);
116+
}
117+
114118
if (isset($body->meta->error_message)) {
115119
throw new InstagramException($body->meta->error_message);
116120
}

0 commit comments

Comments
 (0)