크롤링 봇

URL
api.hashscraper.com/api/get_schedules
요청방식
POST
Port
80
Status
ACTIVE

Header

Key Required Value
Content-Type 필수 application/json; version=2

Parameter

Key Required Description
api_key 필수 해시스크래퍼 API 키 (API키는 오른쪽 위 프로필을 누르신후 내 정보에 가시면 얻을수 있습니다.)
page 페이지 번호

Ruby 샘플코드

begin
  api_key = 'YOUR_API_KEY'

  host = 'api.hashscraper.com'
  port = '80'
  path = "/api/get_schedules"

  request = Net::HTTP::Post.new(path)

  request['Content-Type'] = 'application/json; version=2'
  request.body = {
    api_key: api_key,
    page: '1'
  }.to_json

  response = Net::HTTP.start(host, port) do |http|
    http.request(request)
  end

  puts response.body
rescue => e
  puts e
end

            

Python 샘플코드

import requests
import json

api_key = 'YOUR_API_KEY'

url = 'http://api.hashscraper.com/api/get_schedules'

headers = {
  'Content-Type': 'application/json; version=2'
}

data = {
  'api_key': api_key,
  'page': '1'
}

response = requests.post(url, headers=headers, json=data)

print(response.text)


            

NodeJS 샘플코드

const api_key = 'YOUR_API_KEY';

const host = "api.hashscraper.com";
const port = 80;
const path = "/api/get_schedules";

const requestData = {
  api_key: api_key,
  page: "1",
};

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 샘플코드

<?php

$api_key = 'YOUR_API_KEY';

$host = 'api.hashscraper.com';
$port = '80';
$path = '/api/get_schedules';

$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,
    'page' => '1',
);

$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;

?>

            

Java 샘플코드

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 host = "api.hashscraper.com";
        String port = "80";
        String path = "/api/get_schedules";

        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("page", "1");

            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());
        }
    }
}

            

응답 JSON

{
  "result":"success",
  "version":"v2",
  "data":[{"name":"네이버 블로그 게시물 분석","point":50.0,"update_at":"2023-07-08","version":1.91,"schedule_id":"네이버 블로그 게시물 분석_1690855804309","description":"네이버 블로그에서 키워드 검색을 통해 노출된 포스팅 정보를 수집합니다. \u003cbr\u003e\r\n수집하고 싶은 키워드를 입력한 뒤, 시작일과 종료일을 통해 수집 기간을 설정하세요.\u003cbr\u003e\r\n수집 키워드가 포함된 게시물의 본문 내용을 분석한 감정 분석, 형태소 분석 결과를 확인할 수 있습니다. \u003cbr\u003e\r\n\u003cbr\u003e\r\n* 제외하고 싶은 단어는 검색어 뒤어 \" -키워드\" 형식으로 여러개 추가 가능 \u003cbr\u003e\r\n예) 슈퍼콘 -광고 -후원 (슈퍼콘 키워드로 검색하되 광고, 후원 문구가 포함된 글은 제외)\u003cbr\u003e\r\n\u003cbr\u003e\r\n*감정 분석 값 : -1에 가까울수록 ‘부정’, +1에 가까울수록 ‘긍정’을 의미합니다. \u003cbr\u003e\r\n*수집개수를 설정하지 않으면, 수집 키워드 관련 게시물 전체가 수집됩니다. \u003cbr\u003e"},
  {"name":"네이버 카페 게시물 수집","point":50.0,"update_at":"2023-07-07","version":0.07,"schedule_id":"네이버 카페 게시물 수집_1690855804503","description":"네이버 카페에서 키워드 검색을 통해 노출된 카페 게시물 정보를 수집합니다. \u003cbr\u003e\r\n수집하고 싶은 키워드를 입력한 뒤, 시작일과 종료일을 통해 수집 기간을 설정하세요.\u003cbr\u003e\r\n수집 키워드가 포함된 게시물의 제목, 본문, 작성일을 확인할 수 있습니다. \u003cbr\u003e\r\n\u003cbr\u003e\r\n*수집개수를 설정하지 않으면, 수집 키워드 관련 게시물 전체가 수집됩니다.\u003cbr\u003e\r\n*시작일과 종료일 모두 입력하셔야 날짜 기준으로 수집합니다.\u003cbr\u003e\r\n*거래글 제외 옵션은 기본적으로 켜져 있는 상태에서 수집합니다."}]
}