How to set up multiple query parameters for Imgur API's search endpoints - api

I'm trying to get the URLs of multiple images using Imgur's Gallery Search API.
I ran a test of the API using Postman and was able to get a response.
I then used the q_size_px parameter to specify the size of the image to get.
Status is 200, but I didn't get anything back.
Is there a way to specify multiple parameters for a query?
I want to specify the image size and multiple image types.

From https://api.imgur.com/endpoints/gallery#gallery-search :
SO if you use q_size_px it will ignore you q parameter
So you cant search for multi type and size in same time, you need to do multiple request for each file extenssion

Related

How to limit my api result with edamam API

I am trying to make a call to the edamam API to just get 1 item, right now when I call it I get a lot of results which I don't need, is there a query I can use to limit the results?
I have tried to put maxResults at the end but id doesn't change my response
https://api.edamam.com/api/food-database/v2/parser?session=40&app_id=$id&app_key=$appKey&ingr=rice&maxResults=1
The official documentation does not name any means to actively influence the result set / page size of the result.
There is an OpenAPI specification available as well.
There seems to be basic support for pagination, however that is solely based on a session and only supports iteration instead of full control of which page to request and of which size a page should be.
To obtain the next page, the API user should follow the “next” link from the “_links” section in the result JSON ...
The /auto-complete endpoint allows to provide a limit parameter. However, that does not seem to be supported by the /api/food-database/v2/parser endpoint you're interested in.

How to get some some specific result using MarkLogic search API

I am new to MarkLogic and now I am trying to get some specific result of searching query.
More specifically, searching some word through search API and supposed to get a result of documents which include specific word.
No header information, no rank or any other meta data, just want to get documents as a result.
Is there any way to just one request and get documents as a result?
Or do I need to write some code to get specific result.
I'll be appreciated if you help me.
Thanks
If you are accessing MarkLogic from outside, I'd have a look at a POST call to /v1/search with an Accept header of multipart/mixed. Details should be described here: https://docs.marklogic.com/REST/POST/v1/search
If running inside MarkLogic, you could consider using the low-level cts:search, which indeed returns documents directly. Keep in mind though that it won't paginate results, and it is usually unwise to return more than about 50 to 100 documents at once. It would just hog memory, and not allow for parallel processing.
HTH!

List images in Cloudinary account

I was able to get this link to work: https://API_KEY:API_SECRET#api.cloudinary.com/v1_1/CLOUD_NAME/resources/image/upload But it only shows me the first 10 images, not the entire thing. Any ideas why?
Ref: How do I get a list of my images from cloudinary from client-side JavaScript?
You can utilize the max_results parameter to expend the page size up to 500 resources in a single call. To further list your resources you will need to perform pagination using the next_cursor parameter and the attribute that was included on the last resources call.
It will probably look something like:
https://API_KEY:API_SECRET#api.cloudinary.com/v1_1/CLOUD_NAME/resources/image/upload?max_results=500
and (<next_cursor_value> should be extracted from the last returned response):
https://API_KEY:API_SECRET#api.cloudinary.com/v1_1/CLOUD_NAME/resources/image/upload?max_results=500&next_cursor=<next_cursor_value>
More information is available here (Using Rails syntax):
https://support.cloudinary.com/hc/en-us/articles/205714121-How-do-I-browse-through-all-the-resources-in-my-account-using-the-API-

How to get image URLs in different pages using a single WIKI api call?

We can get text extract of different pages in a single wiki api call by using pipe character ( | ).
For eg : http://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exlimit=max&explaintext&exintro&titles=Yahoo|Google&redirects=
By using this api call, we can get datas about Google and Yahoo in text format. Here we get datas of both Google and Yahoo in a single api call.
I want to get image urls of both Google and Yahoo in a single wiki api call.
Is there any method to get all image urls of different pages in a single wiki api call?
Yes, just switch prop=extracts to prop=images. Works exactly the same way:
http://en.wikipedia.org/w/api.php?action=query&titles=Yahoo|Google&prop=images
The full documentation is here: http://www.mediawiki.org/wiki/API:Properties
To get the url of an image, use prop=imageinfo&iiprop=url for the corresponding file page.
Finally, you can combine it all in one single request, by using the prop=images result as a generator for the prop=imageinfo call:
http://en.wikipedia.org/w/api.php?action=query&prop=imageinfo&iiprop=url&generator=images&titles=Google|Yahoo!
There are some warning because you are missing the format=json. So the correct is
https://en.wikipedia.org/w/api.php?action=query&prop=imageinfo&format=json&iiprop=url&generator=images&titles=Google|Yahoo

Programmatic access to On-Line Encyclopedia of Integer Sequences

Is there a way to search and retrieve the results from On-Line Encyclopedia of Integer Sequences (http://oeis.org) programmatically?
I have searched their site and the results are always returned in html. They do not seem to provide an API but in the policy statement they say its acceptable to access the database programmatically. But how to do it without screen scraping?
Thanks a lot for your help.
The OEIS now provides several points of access, not just ones using their internal format. These seem largely undocumented, so here are all of the endpoints that I have found:
https://oeis.org/search?fmt=json&q=<sequenceTerm>&start=<itemToStartAt>
Returns a JSON formatted response of the results found from the sequenceTerm given. If too many results were returned, count will be > 0 whilst results will be null. If no results were returned, count will be 0. itemToStartAt is used for pagination of results, as only a maximum of 10 are ever returned. This starts at 0. If you wanted to return a second page of results, this would equal 10. Information about what each of the entries means can be found here.
https://oeis.org/search?fmt=text&q=<sequenceTerm>&start=<itemToStartAt>
Exactly the same arguments as before, however this returns it in the OEIS internal format. Which is largely written about here. Unless your project requires it, I'd highly recommend using the JSON format over this.
https://oeis.org/search?fmt=<json|text>&q=id:A<sequenceNumber>
Will return a single result if the sequenceNumber is found. This is the suggested method for obtaining single sequences, as it appears to be far more optimised than some of the alternative methods that can be used as queries. Requests often take under a second. Alternative search query methods can be found on this page.
https://oeis.org/A<sequenceNumber>/graph?png=1
This endpoint can be used to grab the images used to graph the data points. Alternatively, setting png to equal to zero returns the HTML page containing a graph of it.
https://oeis.org/recent.txt
This returns a list of recently updated entries in the OEIS internal format. There are no parameters available, or JSON format, as this seems like a static text file that is simply being served to the client. Due to the length of replies from the OEIS database (for some sequences replies can take above five seconds), I'd highly recommend heavily caching requests and using the above endpoint to update them when they change.
A URL of the form http://oeis.org/search?fmt=text&q=2,5,14,50,233 gives a nicely formatted text output.
But it seems there is no way to get a single sequence in text form.
If you happen to use Mathematica, it sounds like the following notebook might help. It allows you to specify a sequence and automatically import a detailed list of matching entries from the OEIS:
http://www.brotherstechnology.com/math/oeis_mathematica.html
It looks like direct use of their CGI program is the only API they provide.
URL for Searching the Database
https://oeis.org/search?q=id:A000032&fmt=text
gives the plain text form of an entry in their internal format
https://oeis.org/eishelp1.html