List images in Cloudinary account - cloudinary

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-

Related

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

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

Multi-page document as images over REST (additional questions)

I read this question - Multi-page document as images over REST which has very nice answer. We have similar scenario but with some additional requirement.
The request can either return the document as binary data or upload the pdf/jpeg(s) somewhere and return a URL to the uploaded file.
How should the calls be different? What is coming to my mind is to use GET for the binary data response and POST when it uploads and returns URL. When it is POST it will return 201 (Created) and return the URL to the uploaded document.
There is also one more detail about the first point. When uploading and returning a URL we can either upload for a temporary usage (and delete it after some time) or make it permanent. Should we do this by adding query parameter? like - POST /documents/12345.pdf?permanent=true
As in the original question, we also return different jpeg for every page. But the process of creating the document is time consuming so we want to take all pages at one request. What would be the proper way of doing this? I think in the 201 response you can only return one URL.
Is the GET /documents/12345.pdf approach a good alternative of the accept header or there are also other approaches? Would using the slash instead of dot be better, like GET /documents/12345/pdf? This way it wouldn't be needed to parse the "12345.pdf" string.
Thanks!
I've learned a thing or two in the past two years lets see if I can take a stab at this...
You can make the POST request always return the URI of the newly created resource. Do you ever need the POST to return the binary if you're the one providing it in the first place? I think I'm tracking with you in this case the GET would return the binary and the POST would create the resource and return the location (URI) of the newly created resource.
This isn't RESTful as GETs should be safe (GETs don't modify resources). You could make it a PUT if you want to update the status after the fact or when you POST you could add a flag in the request body to mark it should be permanent. Info on POSTing an image and data can be found here
For #3 do you want to fetch or upload everything in one request? You can return whatever you want in the response. You could structure your request in such a way to return a json array of urls. For example if you structure your request similar to my example then GET /documents/12345/1 may return page 1 of document 12345 while GET /documents/12345 may return all pages to document 12345.
For #4 I wouldn't do /pdf as that represents resource hierarchy. PDF is only the representation of the document, not the actual document. I would vote querystring since there may be other attributes. For example imagine trying to do the following with slashes... GET /documents/12345?format=pdf&color=grayscale&quality=300dpi&layout=portrait

Accessing full url of all page images Wikipedia API

I'm experimenting with the Wikipedia API and was trying to get the full urls for all images on a particular page, in this example Google's main page (http://en.wikipedia.org/wiki/Google).
I found the page id through the use of another API and then attempted to use this information in the following API to get the full urls of all images on that page:
http://en.wikipedia.org/w/api.php?action=query&pageids=1092923&generator=images&prop=imageinfo&iiprop=url|dimensions|mime&format=xml
I get some of the page images from this but cannot understand why I am not getting all - specifically the logo which is what I was most interested in. Apologies I am aware that there are similar questions which have been asked but I was not able to find one which would assist me here.
The API does not give you all results at once, it defaults to 10 results. You see in the beginning answer that you have a value for the parameter gimcontinue. If you use it like this you get more images: http://en.wikipedia.org/w/api.php?action=query&pageids=1092923&generator=images&prop=imageinfo&iiprop=url|dimensions|mime&format=xml&gimcontinue=1092923|Google_bike.jpg
Alternatively, you can ask for more images at once using gimlimit like this: http://en.wikipedia.org/w/api.php?action=query&pageids=1092923&generator=images&prop=imageinfo&iiprop=url|dimensions|mime&format=xml&gimlimit=500

How does api archive.org works?

As you surely know web.archive.org lets you inspect the history of a domain, ie:http://web.archive.org/web/*/besttatoo.com
I also has an API: http://archive.org/help/json.php
I need to get data from the API but I can't get many info on how to use it, has anyone used it and can paste some examples of use?
This link provides details about the item LovingU on archive.org:
http://archive.org/details/LovingU&output=json
To create an API query to your liking, use this page:
https://archive.org/advancedsearch.php#raw
That page allows you to choose your output format: JSON, XML, HTML, CSV or RSS and also the parameters your want to see. You can limit the number of results, too.

Facebook Page Insights API and limiting objects

I've succeeded at accessing a Page's insights via:
https://graph.facebook.com/{pageID}/insights
I've even managed to limit the response with this tag:
{pageID}/insights/page_fans/lifetime
... however, this query doesn't seem to work (even though the data is present in the base /insights response):
https://graph.facebook.com/{pageID}/insights/page_posts_impressions/week
... it returns no data. What am I doing wrong? Do I need different app rights? (I'm currently using scope=read_insights,offline_access,read_stream,manage_pages.) It seems expensive to request the entire insights response when I only need a single element.
thanks guys.
You can use FQL to target just the item you're interested in. See: http://developers.facebook.com/docs/reference/fql/insights/
SELECT metric, value
FROM insights
WHERE object_id=111605505520003
AND metric='page_like_adds'
AND end_time=1272351600
AND period=86400