Smart Image Downloader

No algorithm description given

1. Introduction The smart image downloader generates data API download links for given URLs. In many cases end-users provide non-direct links to the images themselves (like the webpage that has the image instead), and behave the service (website) to expect to recognize the image in the URL. This algorithm detects the image in a wide range domains (web services), and saves the image to the data API. For some websites, it also parses album photos, hence it may return multiple data API URLs, if multiple images exist in the given webpage. List of Supported Web Sites: Imgur: images & albums Dropbox: images & albums Twitter: image tweets Flickr: images & albums Box: images & albums Google Photos: images & albums Google Drive: images & albums Pinterest: pins & boards 500px: images Wikipedia: images Imageshack: images 4chan: post images Input: (Required) : Website Url. (Optional) : Resize image (width, height or max dimension) (Optional) : Image format (png, jpg, bmp, etc.) Output: List of data API image link(s). Original Image Dimensions. Resized Image Dimensions. (only if image is resized) Example(s) Example 1. Parameter 1: Wikipedia image web page link. {
 "image": "https://en.wikipedia.org/wiki/Barack_Obama#/media/File:President_Barack_Obama.jpg"
} Output: {
 "originalDimensions": [
 {
 "height": 3356,
 "width": 2687
 }
 ],
 "savePath": [
 "data://.algo/util/SmartImageDownloader/temp/418ff024-dbb3-42eb-8e4d-3084b3dba00d.jpg"
 ]
} Example 2 Parameter 1. Wikipedia image web page link. Parameter 2. Image resizing settings. {
 "image": "https://en.wikipedia.org/wiki/Barack_Obama#/media/File:President_Barack_Obama.jpg",
 "resize": {
 "width": 512,
 "height": 512
 }
} Output: {
 "originalDimensions": [
 {
 "height": 3356,
 "width": 2687
 }
 ],
 "resizedDimensions": [
 {
 "height": 512,
 "width": 512
 }
 ],
 "savePath": [
 "data://.algo/util/SmartImageDownloader/temp/7ebeeaf6-66b1-4d71-b7f6-a08dfcf0d89c.jpg"
 ]
} Example 3 Parameter 1. Wikipedia image web page link. Parameter 2. Image format setting. {
 "image": "https://en.wikipedia.org/wiki/Barack_Obama#/media/File:President_Barack_Obama.jpg",
 "format": "png"
} Output: {
 "originalDimensions": [
 {
 "height": 3356,
 "width": 2687
 }
 ],
 "savePath": [
 "data://.algo/util/SmartImageDownloader/temp/8d0a406c-de5e-45e2-8b54-0f6ff60a825c.png"
 ]
} Example 4 Parameter 1. Wikipedia image web page link. Parameter 2. Max dimension for image resizing (autoscales according to largest side -width or height-). eg. if 600, larger side becomes 1200, other side scales according to width/height ratio. {
 "image": "https://en.wikipedia.org/wiki/Barack_Obama#/media/File:President_Barack_Obama.jpg",
 "resize": 600
} Output: {
 "originalDimensions": [
 {
 "height": 3356,
 "width": 2687
 }
 ],
 "resizedDimensions": [
 {
 "height": 600,
 "width": 480
 }
 ],
 "savePath": [
 "data://.algo/util/SmartImageDownloader/temp/81917ff3-9b07-4694-b3e2-f260b162da8f.jpg"
 ]
}

Tags
(no tags)

Cost Breakdown

0 cr
royalty per call
1 cr
usage per second
avg duration

Cost Calculator

API call duration (sec)
×
API calls
=
Estimated cost
per calls
for large volume discounts
For additional details on how pricing works, see Algorithmia pricing.

Internet access

This algorithm has Internet access. This is necessary for algorithms that rely on external services, however it also implies that this algorithm is able to send your input data outside of the Algorithmia platform.


To understand more about how algorithm permissions work, see the permissions documentation.

1. Type your input

2. See the result

Running algorithm...

3. Use this algorithm

curl -X POST -d '{{input | formatInput:"curl"}}' -H 'Content-Type: application/json' -H 'Authorization: Simple YOUR_API_KEY' https://api.algorithmia.com/v1/algo/util/SmartImageDownloader/0.2.1
View cURL Docs
algo auth
# Enter API Key: YOUR_API_KEY
algo run algo://util/SmartImageDownloader/0.2.1 -d '{{input | formatInput:"cli"}}'
View CLI Docs
import com.algorithmia.*;
import com.algorithmia.algo.*;

String input = "{{input | formatInput:"java"}}";
AlgorithmiaClient client = Algorithmia.client("YOUR_API_KEY");
Algorithm algo = client.algo("algo://util/SmartImageDownloader/0.2.1");
AlgoResponse result = algo.pipeJson(input);
System.out.println(result.asJsonString());
View Java Docs
import com.algorithmia._
import com.algorithmia.algo._

val input = {{input | formatInput:"scala"}}
val client = Algorithmia.client("YOUR_API_KEY")
val algo = client.algo("algo://util/SmartImageDownloader/0.2.1")
val result = algo.pipeJson(input)
System.out.println(result.asJsonString)
View Scala Docs
var input = {{input | formatInput:"javascript"}};
Algorithmia.client("YOUR_API_KEY")
           .algo("algo://util/SmartImageDownloader/0.2.1")
           .pipe(input)
           .then(function(output) {
             console.log(output);
           });
View Javascript Docs
var input = {{input | formatInput:"javascript"}};
Algorithmia.client("YOUR_API_KEY")
           .algo("algo://util/SmartImageDownloader/0.2.1")
           .pipe(input)
           .then(function(response) {
             console.log(response.get());
           });
View NodeJS Docs
import Algorithmia

input = {{input | formatInput:"python"}}
client = Algorithmia.client('YOUR_API_KEY')
algo = client.algo('util/SmartImageDownloader/0.2.1')
print algo.pipe(input)
View Python Docs
library(algorithmia)

input <- {{input | formatInput:"r"}}
client <- getAlgorithmiaClient("YOUR_API_KEY")
algo <- client$algo("util/SmartImageDownloader/0.2.1")
result <- algo$pipe(input)$result
print(result)
View R Docs
require 'algorithmia'

input = {{input | formatInput:"ruby"}}
client = Algorithmia.client('YOUR_API_KEY')
algo = client.algo('util/SmartImageDownloader/0.2.1')
puts algo.pipe(input).result
View Ruby Docs
use algorithmia::*;

let input = {{input | formatInput:"rust"}};
let client = Algorithmia::client("YOUR_API_KEY");
let algo = client.algo('util/SmartImageDownloader/0.2.1');
let response = algo.pipe(input);
View Rust Docs
Discussion
  • {{comment.username}}