Instagram API /media/search maximum count parameter? - instagram

When using Python to make a GET request to the Instagram API, passing the required variables as shown below
photos = api.media_search(lat=latitude, lng=longitude, distance=distance, count=count)
I have attempted to set the count parameter to over 100, but the API returns a maximum of 100 results.
Is this a limitation set for the API or am I doing something wrong?

The Instagram API documentation says there is a max value for count for each endpoint, from the docs:
On views where pagination is present, we also support the "count" parameter. Simply set this to the number of items you'd like to receive. Note that the default values should be fine for most applications - but if you decide to increase this number there is a maximum value defined on each endpoint.
However, I couldn't find any indication for that number in the documentation, neither for the media request nor for other requests. So I would assume that they don't guarantee any specific number.
They do specify that if the application is in sandbox mode, the data is restricted to 20 most recent media.

Related

How to retrieve all results from NearBySearch on Azure?

I am using NearBySearch from Microsoft Azure. In the official documentation it says that when you make a query the totalResults that the API can return is X. However, you can also read that there is a limit on the number of items returned which is at most 100.
In the case that the totalResults >= limit == 100, the API will only display the first 100 results, thus not showing the remaining ones.
Question: Would you be able to suggest a way to retrieve the additional results using the NearBySearch function?
Note: On the Google API NearBySearch there is a parameter called next_page_token, which allows to view all the possible results. Is there something similar in Azure?
You have a limit of 100 results each query. If you have 150 totalResults. You can execute the query with ofs= 0 and limit= 100 to get the first 100 entries. After that you execute the second query with the ofs=100 (because it is like an index). Your limit is 100. After that you will get the next 100 results. Because there are only 50 results left, your numResults will be 50.
I hope it is understandable
Would you be able to suggest a way to retrieve the additional results
using the NearBySearch function?
Looking at the documentation, I noticed that there is an offset parameter (ofs) which by default is zero. You should be able to use that to get the next set of results if the total results are more than the limit specified by you.

Can retrieve only 20 documents from a folder

I have a Spring CM folder that has 1000s of small files in it. I'm doing retrieval this way:
GET /v201411/folders/{id}/documents
but when it executes, I get back only 20 files. The sum of all of their sizes is: 1.8 MB and the Content Length of the response -> content -> headers is only 3.8 MB.
I didn't find anything in their documentations that mentions the limit of retrieving documents via the api.
Is that really the limitation of spring CM?
From the documentation on API Collections:
Limit (integer): The maximum number of elements retrieved per request.
Default limit is 20. Maximum limit is 100
When there are more items in the collection than the specified limit,
the application can page through the collection, retrieving the
objects in chunks by specifying the limit and/or offset on the query
string when the collection is requested. The first, previous, next,
and last properties are added as a convenience by appending the
appropriate limit and offset to the URI and a GET request can be done
to this URIs specified by these properties to navigate the collection.
To minimize the number of sequential calls you need to make, you can adjust the limit property up to the max, 100.

Logic App Until action, how to set count dynamically?

I have a logic app that is fetching data from an API endpoint. The API is using pagination and has an limit of 50 objects per request and then provides an link for the next 50 objects until it gets all the objects, however I have no idea on how many objects there will be for each request. My flow is briefly described down below:
First make an initial HTTP request against the endpoint
Parsing the response HTTP Body to be able to use the nextLink url provided.
Until loop with the conditon to run until nextLink is equal to null.
In the until loop I have an action for Set Variable that get Set to a new URL for each request made with a new pagination in the end of the url: "&_offset=100"
The issue with the until loop is that you can set limits for count and timeout as you can see here. As I have no clue on how many pagination there will be I am expecting this loop to run until the condition specified is met. However, I have tried specify some different values listed below:
Count = 1 - Resulted in just 1 run
Count = empty - Resulted in it running for an hour (approx 3300 loops), as specified by the Timeout value.
Count = 60 - Resulted in it running for 60 times
I have researched on how many pagination this specific request has and it turns out it has 290 paginations. My expectations is that this until loop will run until nextLink is equal to null which will be after 290 loops. But I wonder if there is any possibiliy to specify a dynamic value for Count in the until action?
I am expecting the UNTIL action to run as many time as needed based on how many pagination there is, that is atleast what I suppose it should do because if I need to specify a value for how many times it needs to run then this action is pretty useless. Hopefully there is someone in here that maybe have faced the same issue.
Best regards
As far as I know, "Until" action requires us to define at least one limit to prevent endless loops.
For your problem, you can just define a count which is large enough to allow your endpoints show all of the pages. If you want to specify a dynamic value for the count, you need to meet two conditions:
You have to be able to access total number of pages (if your endpoint provides a url to get it).
The count set in "Until" action can only reference trigger inputs, trigger outputs and parameters.
According to the statement in your question, I guess you can't meet these two conditions. So I think we can just set a count which is large enough.

Azure DevOps REST API - Get Capacity Bar from each Member

I want to get the workload foreach teammember from the Devops API, so that I can visualize the same like what you can see in the picture and here: https://learn.microsoft.com/en-us/azure/devops/boards/sprints/adjust-work?view=azure-devops
I already saw that there is a capacity endpoint: https://learn.microsoft.com/en-us/rest/api/azure/devops/work/capacities/list?view=azure-devops-rest-5.1.
But this shows only the available hours foreach member in a week. I want all workItems per Member (hours summed up).
Is there a possible way to achieve this? Am I missing something?
I’m afraid that there is not a REST API can get the value directly at present. Before the value is displayed on the page, it is computed several times at the backend. After your assigned the work items to members, the page will show as following. It will show all work items per members(hours summed up) and capacity hours.
If you want to get the value by REST API, you can check the API from Fiddler, then follow the format of the API to pass the your value. Or you can get the member capacity and the Iteration work days then use the script to calculate this value manually.

what is max count for instagram get recent media api?

In Instagram api documentation, for api GET/users/user-id/media/recent
it doesn't mention what is max count supported for each api call.
Does anyone has idea about it? Thanks.
It appears there is no limit for /users/user-id/media/recent - at least I just ran this and got 5500+ results back for user '787132' (natgeo). If you want to limit it use the count parameter.
Note that other endpoints seem to have limits e.g. /media/popular will usually return a max of 20.
Also be aware that if you do not limit using the count param you might reach your global / endpoint specific rate limit as per http://instagram.com/developer/limits/

Resources