봇 세팅
URL
api.hashscraper.com/api/set_schedule
요청방식
POST
Port
80
Status
ACTIVE
Header
Key | Required | Value |
---|---|---|
Content-Type |
필수 | application/json; version=2 |
Parameter
Key | Required | Description |
---|---|---|
api_key |
필수 | 해시스크래퍼 API 키 (API키는 오른쪽 위 프로필을 누르신후 내 정보에 가시면 얻을수 있습니다.) |
schedule_id |
필수 | Schedule Id |
param1 |
Param1 | |
param2 |
Param2 | |
param3 |
Param3 | |
param4 |
Param4 | |
param5 |
Param5 | |
period |
"manual", "day", "hour" 중 하나를 입력합니다. 미입력 시 현재 값을 유지합니다. | |
union |
유니온 여부를 설정합니다. "true" 또는 "false"의 불리언 형태로 입력합니다. |
샘플코드
- cURL
- Ruby
- Python
- NodeJS
- PHP
- Java
curl -X POST \
--header "Content-Type: application/json; version=2" \
--data '{
"api_key": "YOUR_API_KEY",
"schedule_id": "YOUR_SCHEDULE_ID",
"param1": "PARAM1",
"param2": "PARAM2",
"param3": "PARAM3",
"param4": "PARAM4",
"param5": "PARAM5"
}' \
'api.hashscraper.com/api/set_schedule'
begin
api_key = 'YOUR_API_KEY'
schedule_id = 'YOUR_SCHEDULE_ID'
host = 'api.hashscraper.com'
port = '80'
path = "/api/set_schedule"
request = Net::HTTP::Post.new(path)
request['Content-Type'] = 'application/json; version=2'
request.body = {
api_key: api_key,
schedule_id: schedule_id,
param1: 'PARAM1',
param2: 'PARAM2',
param3: 'PARAM3',
param4: 'PARAM4',
param5: 'PARAM5'
}.to_json
response = Net::HTTP.start(host, port) do |http|
http.request(request)
end
puts response.body
rescue => e
puts e
end
import requests
import json
api_key = 'YOUR_API_KEY'
schedule_id = 'YOUR_SCHEDULE_ID'
url = 'http://api.hashscraper.com/api/set_schedule'
headers = {
'Content-Type': 'application/json; version=2'
}
data = {
'api_key': api_key,
'schedule_id': schedule_id,
'param1': 'PARAM1',
'param2': 'PARAM2',
'param3': 'PARAM3',
'param4': 'PARAM4',
'param5': 'PARAM5'
}
response = requests.post(url, headers=headers, json=data)
print(response.text)
const api_key = 'YOUR_API_KEY';
const schedule_id = 'YOUR_SCHEDULE_ID';
const host = "api.hashscraper.com";
const port = 80;
const path = "/api/set_schedule";
const requestData = {
api_key: api_key,
schedule_id: schedule_id,
param1: "PARAM1",
param2: "PARAM2",
param3: "PARAM3",
param4: "PARAM4",
param5: "PARAM5",
};
const requestOptions = {
method: "POST",
headers: {
"Content-Type": "application/json; version=2",
},
body: JSON.stringify(requestData),
};
async function makeRequest() {
try {
const response = await fetch(
`http://${host}:${port}${path}`,
requestOptions
);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error.message);
}
}
makeRequest();
<?php
$api_key = 'YOUR_API_KEY';
$schedule_id = 'YOUR_SCHEDULE_ID';
$host = 'api.hashscraper.com';
$port = '80';
$path = '/api/set_schedule';
$url = 'http://' . $host . ':' . $port . $path;
$user_agent = "MyApp/1.0"; // 원하는 User-Agent 값을 여기에 설정하세요
$headers = array(
'Content-Type: application/json; version=2',
"User-Agent: $user_agent"
);
$data = array(
'api_key' => $api_key,
'schedule_id' => $schedule_id,
'param1' => 'PARAM1',
'param2' => 'PARAM2',
'param3' => 'PARAM3',
'param4' => 'PARAM4',
'param5' => 'PARAM5',
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if($response === false) {
die('Error: ' . curl_error($ch));
}
curl_close($ch);
echo $response;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
public class Main {
public static void main(String[] args) {
String apiKey = 'YOUR_API_KEY';
String scheduleId = 'YOUR_SCHEDULE_ID';
String host = "api.hashscraper.com";
String port = "80";
String path = "/api/set_schedule";
try {
URL url = new URL("http://" + host + ":" + port + path);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", "application/json; version=2");
connection.setDoOutput(true);
JSONObject jsonRequest = new JSONObject();
jsonRequest.put("api_key", apiKey);
jsonRequest.put("schedule_id", scheduleId);
jsonRequest.put("param1", "PARAM1");
jsonRequest.put("param2", "PARAM2");
jsonRequest.put("param3", "PARAM3");
jsonRequest.put("param4", "PARAM4");
jsonRequest.put("param5", "PARAM5");
OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream());
out.write(jsonRequest.toString());
out.flush();
out.close();
int responseCode = connection.getResponseCode();
StringBuilder response = new StringBuilder();
if (responseCode == HttpURLConnection.HTTP_OK) {
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
}
System.out.println(response.toString());
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
}