クイックスタート
1分以内に最初のプロキシ経由リクエストを送信しましょう。
-
アカウントを作成してプランを選択する
shifter.io/order でサインアップし、プランを選択してください。
-
認証情報を取得する
クライアントダッシュボード を開き、プロキシのユーザー名とパスワード(Scraping/SERP APIの場合はAPIキー)をコピーしてください。以下のような形式です。
Username: customer-USERNAMEPassword: 5f8a9c2b1d3e4f6g7h8iGateway: p.shifter.io:443 -
最初のリクエストを送信する
任意のHTTP呼び出しをゲートウェイ経由でルーティングします。ユーザー名にターゲティング情報がエンコードされています。
Terminal window curl -x customer-USERNAME-country-us-sid-9f3a2b7c-ttl-600:PASSWORD@p.shifter.io:443 \https://ipinfo.io/jsonimport requestsproxy = "customer-USERNAME-country-us-sid-9f3a2b7c-ttl-600:PASSWORD@p.shifter.io:443"proxies = {"http": proxy, "https": proxy}r = requests.get("https://ipinfo.io/json", proxies=proxies)print(r.text)import fetch from 'node-fetch';import { HttpsProxyAgent } from 'https-proxy-agent';const agent = new HttpsProxyAgent('customer-USERNAME-country-us-sid-9f3a2b7c-ttl-600:PASSWORD@p.shifter.io:443');const res = await fetch('https://ipinfo.io/json', { agent });console.log(await res.text());import axios from 'axios';import { HttpsProxyAgent } from 'https-proxy-agent';const agent = new HttpsProxyAgent('customer-USERNAME-country-us-sid-9f3a2b7c-ttl-600:PASSWORD@p.shifter.io:443');const { data } = await axios.get<string>('https://ipinfo.io/json', {httpAgent: agent,httpsAgent: agent,});console.log(data);const fetch = require('node-fetch');const { HttpsProxyAgent } = require('https-proxy-agent');const agent = new HttpsProxyAgent('customer-USERNAME-country-us-sid-9f3a2b7c-ttl-600:PASSWORD@p.shifter.io:443');fetch('https://ipinfo.io/json', { agent }).then((r) => r.text()).then(console.log);package mainimport ("fmt""io""net/http""net/url")func main() {proxyURL, _ := url.Parse("customer-USERNAME-country-us-sid-9f3a2b7c-ttl-600:PASSWORD@p.shifter.io:443")client := &http.Client{Transport: &http.Transport{Proxy: http.ProxyURL(proxyURL)},}resp, _ := client.Get("https://ipinfo.io/json")defer resp.Body.Close()body, _ := io.ReadAll(resp.Body)fmt.Println(string(body))}use reqwest::blocking::Client;use reqwest::Proxy;fn main() -> Result<(), Box<dyn std::error::Error>> {let proxy = Proxy::all("http://p.shifter.io:443")?.basic_auth("customer-USERNAME-country-us-sid-9f3a2b7c-ttl-600", "PASSWORD");let client = Client::builder().proxy(proxy).build()?;let body = client.get("https://ipinfo.io/json").send()?.text()?;println!("{body}");Ok(())}import java.net.*;import java.net.http.*;public class Main {public static void main(String[] args) throws Exception {HttpClient client = HttpClient.newBuilder().proxy(ProxySelector.of(new InetSocketAddress("p.shifter.io", 443))).authenticator(new Authenticator() {protected PasswordAuthentication getPasswordAuthentication() {return new PasswordAuthentication("customer-USERNAME-country-us-sid-9f3a2b7c-ttl-600","PASSWORD".toCharArray());}}).build();HttpRequest req = HttpRequest.newBuilder(URI.create("https://ipinfo.io/json")).build();HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());System.out.println(res.body());}}using System.Net;using System.Net.Http;var handler = new HttpClientHandler{Proxy = new WebProxy("http://p.shifter.io:443"){Credentials = new NetworkCredential("customer-USERNAME-country-us-sid-9f3a2b7c-ttl-600","PASSWORD")},UseProxy = true};using var client = new HttpClient(handler);var ip = await client.GetStringAsync("https://ipinfo.io/json");Console.WriteLine(ip);<?phprequire 'vendor/autoload.php';$client = new GuzzleHttp\Client(['proxy' => 'customer-USERNAME-country-us-sid-9f3a2b7c-ttl-600:PASSWORD@p.shifter.io:443',]);$res = $client->get('https://ipinfo.io/json');echo $res->getBody(); -
国、セッション、ISPを指定する
パラメータを使用して、地域、セッション、ルーティングを制御します。
Parameter Example Effect country-XXcustomer-USERNAME-country-deドイツ経由でルーティングする region-NAMEcustomer-USERNAME-region-california特定の地域/州をターゲットにする city-NAMEcustomer-USERNAME-city-new_york特定の都市をターゲットにする asn-NUMBERcustomer-USERNAME-asn-7922特定のASNをターゲットにする sid-IDcustomer-USERNAME-sid-abcスティッキーセッション(デフォルトのTTLである120秒間、同じIPを保持する) ttl-SECONDScustomer-USERNAME-sid-abc-ttl-600スティッキーセッションのTTLを秒単位でカスタム指定する( sidが必要)strict-truecustomer-USERNAME-country-us-strict-trueより広いプールへのフォールバックを行わず、502で失敗する
次のステップ
Section titled “次のステップ”- Authentication - APIキーとユーザー名/パスワードの違い
- Choosing a product - 最適なShifter製品の選び方
- API Reference - すべてのRESTエンドポイントとすべてのパラメータ