Akun Resmi WeChat Pencarian Akun API (V2)
Status kesehatan API
Sehat Tersedia Terbatas Sebagian besar tidak tersedia Tidak ada data
Memuat status kesehatan...
Cari Akun Resmi WeChat menggunakan kata kunci, dengan paginasi halaman, offset, dan status kelanjutan. Gunakan untuk membuka hasil pencarian akun yang lebih luas untuk penemuan pembuat, merek, atau penerbit.
Body Permintaan
| Nama | Lokasi | Jenis | Wajib | Bawaan | Deskripsi |
|---|---|---|---|---|---|
token |
form | string |
Ya | - | Token akses untuk layanan API ini. |
keyword |
form | string |
Ya | - | Kata kunci untuk pencarian web akun resmi WeChat. |
currentPage |
form | integer |
Tidak | 1 |
Halaman nomor saat ini, dimulai dari 1 untuk paginasi pencarian WeChat di web. |
offset |
form | integer |
Tidak | 0 |
Offset hasil pencarian yang dikembalikan oleh respons sebelumnya. Gunakan 0 untuk halaman pertama. |
cookies_buffer |
form | string |
Tidak | |
Status paginasi yang tidak jelas yang dikembalikan oleh respons pencarian WeChat sebelumnya. Biarkan kosong untuk halaman pertama. Untuk endpoint POST ini, kirimkan dalam format body application/x-www-form-urlencoded. |
Contoh Kode
bash
curl --max-time 120 -X POST 'https://api.justoneapi.com/api/weixin/search-account/v2' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'token=YOUR_API_KEY&keyword=string¤tPage=1&offset=0&cookies_buffer='
text
Saya ingin menggunakan API "Pencarian Akun (V2)" dari JustOneAPI.
URL dasar: https://api.justoneapi.com.
Jalur API: /api/weixin/search-account/v2
Endpoint API: BASE_URL + /api/weixin/search-account/v2
Metode HTTP: POST
Autentikasi: Kirimkan "token" sebagai field body dalam format application/x-www-form-urlencoded.
Definisi OpenAPI: https://docs.justoneapi.com/openapi/wechat-official-accounts/account-search-v2-id.json
Header permintaan:
- Content-Type: application/x-www-form-urlencoded
Body Permintaan (Formulir):
- token (form): Token akses untuk layanan API ini. (Wajib)
- keyword (form): Kata kunci untuk pencarian web akun resmi WeChat. (Wajib)
- currentPage (form): Halaman nomor saat ini, dimulai dari 1 untuk paginasi pencarian WeChat di web.
- offset (form): Offset hasil pencarian yang dikembalikan oleh respons sebelumnya. Gunakan 0 untuk halaman pertama.
- cookies_buffer (form): Status paginasi yang tidak jelas yang dikembalikan oleh respons pencarian WeChat sebelumnya. Biarkan kosong untuk halaman pertama. Untuk endpoint POST ini, kirimkan dalam format body application/x-www-form-urlencoded.
Format Kembalian: tangani dengan aman JSON atau teks sesuai dengan Content-Type yang sebenarnya.
Penanganan respons dan kode kesalahan:
1. Tentukan hasil pemrosesan dari kolom "code" dalam isi respons (code 0 berarti berhasil).
2. Batas waktu yang disarankan: Atur batas waktu permintaan menjadi 120 detik. Jika 120 detik terlalu lama untuk kebutuhan Anda, gunakan setidaknya 60 detik. Sebagian kecil permintaan mungkin mencapai batas waktu sebelum hasil diterima.
3. Kode hasil:
- 0: Berhasil
- 100: Token tidak valid atau tidak aktif
- 301: Gagal mengambil data. Silakan coba lagi.
- 302: Batas frekuensi permintaan terlampaui
- 303: Kuota harian terlampaui
- 400: Parameter tidak valid
- 500: Kesalahan internal server
- 600: Akses ditolak
- 601: Saldo tidak mencukupi
- 602: Batas anggaran token tercapai
4. Kode 601 berarti saldo bersama akun tidak mencukupi. Kode 602 berarti token API yang digunakan telah mencapai batas anggaran kumulatifnya sendiri. Menetapkan batas anggaran token tidak memindahkan dana dari saldo bersama akun.
Tolong bantu saya menulis skrip dalam bahasa pemrograman favorit saya untuk memanggil API ini dan menangani responsnya.
python
import requests
BASE_URL = "https://api.justoneapi.com" # Diberikan oleh server OpenAPI
url = BASE_URL + "/api/weixin/search-account/v2"
headers = {
"Content-Type": "application/x-www-form-urlencoded"
}
data = "token=YOUR_API_KEY&keyword=string¤tPage=1&offset=0&cookies_buffer="
response = requests.post(url, headers=headers, data=data, timeout=120)
print(response.status_code)
if response.content:
content_type = response.headers.get("content-type", "").lower()
if "json" in content_type:
try:
print(response.json())
except ValueError:
print(response.text)
elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}:
print(response.text)
else:
with open("response.bin", "wb") as output:
output.write(response.content)
print(f"Saved {len(response.content)} bytes to response.bin")
js
const BASE_URL = "https://api.justoneapi.com"; // Diberikan oleh server OpenAPI
const url = BASE_URL + "/api/weixin/search-account/v2";
const response = await fetch(url, {
method: "POST",
headers: Object.fromEntries([
["Content-Type", "application/x-www-form-urlencoded"],
]),
body: "token=YOUR_API_KEY&keyword=string¤tPage=1&offset=0&cookies_buffer=",
signal: AbortSignal.timeout(120000)
});
console.log(response.status);
const responseBytes = await response.arrayBuffer();
if (responseBytes.byteLength) {
const contentType = (response.headers.get("content-type") || "").toLowerCase();
const mediaType = contentType.split(";", 1)[0].trim();
const textual = contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("xml") || ["application/javascript", "application/x-www-form-urlencoded", "application/graphql"].includes(mediaType);
if (textual) {
const responseText = new TextDecoder().decode(responseBytes);
let data = responseText;
if (contentType.includes("json")) {
try { data = JSON.parse(responseText); } catch { /* Keep the raw body. */ }
}
console.log(data);
} else {
console.log(`Received ${responseBytes.byteLength} binary bytes`);
}
}
java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
public class Main {
public static void main(String[] args) throws Exception {
final String BASE_URL = "https://api.justoneapi.com"; // Diberikan oleh server OpenAPI
final String url = BASE_URL + "/api/weixin/search-account/v2";
HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(120)).build();
HttpRequest.Builder builder = HttpRequest.newBuilder()
.uri(URI.create(url))
.timeout(Duration.ofSeconds(120))
.header("Content-Type", "application/x-www-form-urlencoded")
.method("POST", HttpRequest.BodyPublishers.ofString("token=YOUR_API_KEY&keyword=string¤tPage=1&offset=0&cookies_buffer="));
HttpRequest request = builder.build();
HttpResponse<byte[]> response = client.send(request, HttpResponse.BodyHandlers.ofByteArray());
System.out.println(response.statusCode());
String contentType = response.headers().firstValue("content-type").orElse("").toLowerCase();
String mediaType = contentType.split(";", 2)[0].trim();
if (contentType.startsWith("text/") || contentType.contains("json") || contentType.contains("xml") || mediaType.equals("application/javascript") || mediaType.equals("application/x-www-form-urlencoded") || mediaType.equals("application/graphql")) {
System.out.println(new String(response.body(), StandardCharsets.UTF_8));
} else {
Files.write(Path.of("response.bin"), response.body());
System.out.println("Saved " + response.body().length + " bytes to response.bin");
}
}
}
go
package main
import (
"fmt"
"io"
"os"
"strings"
"net/http"
"time"
)
const BASE_URL = "https://api.justoneapi.com" // Diberikan oleh server OpenAPI
func main() {
client := &http.Client{Timeout: 120 * time.Second}
url := BASE_URL + "/api/weixin/search-account/v2"
var data = strings.NewReader("token=YOUR_API_KEY&keyword=string¤tPage=1&offset=0&cookies_buffer=")
req, _ := http.NewRequest("POST", url, data)
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
resp, _ := client.Do(req)
defer resp.Body.Close()
fmt.Println(resp.StatusCode)
bodyBytes, _ := io.ReadAll(resp.Body)
contentType := strings.ToLower(resp.Header.Get("Content-Type"))
mediaType := strings.TrimSpace(strings.SplitN(contentType, ";", 2)[0])
if strings.HasPrefix(contentType, "text/") || strings.Contains(contentType, "json") || strings.Contains(contentType, "xml") || mediaType == "application/javascript" || mediaType == "application/x-www-form-urlencoded" || mediaType == "application/graphql" {
fmt.Println(string(bodyBytes))
} else {
os.WriteFile("response.bin", bodyBytes, 0600)
fmt.Printf("Saved %d bytes to response.bin\n", len(bodyBytes))
}
}
php
<?php
$BASE_URL = 'https://api.justoneapi.com'; // Diberikan oleh server OpenAPI
$url = $BASE_URL . '/api/weixin/search-account/v2';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, 'token=YOUR_API_KEY&keyword=string¤tPage=1&offset=0&cookies_buffer=');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/x-www-form-urlencoded',
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$contentType = strtolower((string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE));
curl_close($ch);
echo $status . PHP_EOL;
$mediaType = trim(explode(';', $contentType, 2)[0]);
if (str_starts_with($contentType, 'text/') || str_contains($contentType, 'json') || str_contains($contentType, 'xml') || in_array($mediaType, ['application/javascript', 'application/x-www-form-urlencoded', 'application/graphql'], true)) {
echo $response;
} else {
file_put_contents('response.bin', $response);
echo 'Saved ' . strlen($response) . ' bytes to response.bin' . PHP_EOL;
}
Field Respons
Field Kunci dalam respons yang sukses (code = 0).
Status dan kelanjutan6 kolom
data
Hasil pencarian akun resmi WeChat dan informasi lanjutan. Permintaan lanjutan bisa menghasilkan objek hasil kosong.
| Kolom | Jenis | Deskripsi |
|---|---|---|
query |
string |
Kueri pencarian yang dilaporkan dalam respons. |
ret |
integer |
Kode status pencarian yang dilaporkan oleh WeChat. |
pageNumber |
integer |
Nomor halaman yang dilaporkan untuk hasil pencarian terstruktur. |
offset |
integer |
Offset hasil yang dikirimkan untuk lanjutan. Kirimkan sebagai offset dalam permintaan formulir berikutnya. |
continueFlag |
integer |
Indikator lanjutan yang dilaporkan oleh WeChat, sebagai bilangan bulat. |
cookies |
string |
Status lanjutan yang tidak jelas. Kirimkan bidang ini tanpa perubahan sebagai cookies_buffer dalam formulir saat melanjutkan pencarian yang sama. |
Kelompok hasil11 kolom
data
| Kolom | Jenis | Deskripsi |
|---|---|---|
data |
array |
Bagian hasil pencarian yang diterima untuk kueri, jika tersedia. |
data[] |
object |
Satu bagian dalam hasil pencarian. |
data[].boxExtraInfo |
object |
Informasi tampilan untuk bagian hasil pencarian. |
data[].boxExtraInfo.title |
string |
Judul tampilan untuk bagian hasil pencarian ini. |
data[].subBoxes |
array |
Kelompok hasil yang dikirimkan dalam bagian ini. |
data[].subBoxes[] |
object |
Satu kelompok hasil dalam bagian pencarian. |
data[].subBoxes[].title |
string |
Judul tampilan yang dilaporkan untuk grup hasil. |
data[].subBoxes[].count |
integer |
Jumlah item hasil yang dilaporkan untuk grup ini. |
data[].subBoxes[].totalCount |
integer |
Jumlah total yang dilaporkan bersama grup. Ini dapat berbeda dari jumlah item yang dikembalikan. |
data[].subBoxes[].items |
array |
Entri hasil akun yang dikembalikan dalam grup. |
data[].subBoxes[].items[] |
object |
Satu entri hasil akun. |
Detail Akun Resmi13 kolom
data.data[].subBoxes[].items[]
| Kolom | Jenis | Deskripsi |
|---|---|---|
title |
string |
Judul tampilan hasil akun. Ini dapat termasuk tanda penekanan pencarian. |
desc |
string |
Potongan deskripsi yang ditampilkan untuk akun. Ini dapat termasuk tanda penekanan pencarian. |
iconUrl |
string |
URL gambar ikon yang dikembalikan bersama hasil akun. |
jumpInfo |
object |
Detail akun publik yang dilaporkan dalam hasil pencarian. |
jumpInfo.userName |
string |
Identifikasi Akun Resmi yang dikembalikan sebagai teks. Identifikasi ini sering dimulai dengan gh_. |
jumpInfo.aliasName |
string |
Alias akun publik yang dikembalikan sebagai teks. Ini dapat kosong. |
jumpInfo.nickName |
string |
Nama tampilan yang dilaporkan untuk Akun Resmi. |
jumpInfo.bizuin |
string |
Identifikasi Akun Bisnis yang dikembalikan sebagai teks, jika diberikan. |
jumpInfo.bizType |
integer |
Kode jenis Akun Bisnis yang dilaporkan untuk akun. |
jumpInfo.verifyFlag |
integer |
Indikator verifikasi yang dilaporkan untuk akun, sebagai bilangan bulat. |
jumpInfo.headImgUrl |
string |
URL gambar avatar akun. |
jumpInfo.headHDImgUrl |
string |
URL gambar avatar akun dengan resolusi tinggi. |
jumpInfo.iconUrl |
string |
URL gambar ikon yang dilaporkan bersama detail akun. |
Sumber dan label13 kolom
data.data[].subBoxes[].items[]
| Kolom | Jenis | Deskripsi |
|---|---|---|
source |
object |
Informasi label sumber yang ditampilkan pada hasil akun. |
source.title |
string |
Judul tampilan sumber hasil akun. |
source.auth |
integer |
Indikator verifikasi yang dilaporkan untuk label sumber. |
source.authIconUrl |
string |
URL gambar ikon verifikasi yang dikembalikan bersama label sumber. |
source.tag |
array |
Tag yang dilaporkan bersama label sumber yang ditampilkan. |
source.tag[] |
object |
Satu tag yang dilaporkan bersama label sumber. |
source.tag[].title |
string |
Judul tampilan tag sumber. |
source.tag[].type |
integer |
Kode jenis yang dilaporkan untuk tag sumber. |
titleTag |
object |
Informasi tag yang ditampilkan bersama dengan judul hasil akun. |
titleTag.append |
array |
Tag yang ditambahkan ke judul hasil akun. |
titleTag.append[] |
object |
Satu tag yang ditambahkan ke judul hasil akun. |
titleTag.append[].title |
string |
Judul tampilan tag yang ditambahkan ke judul hasil akun. |
titleTag.append[].type |
integer |
Kode jenis tag yang ditambahkan ke judul hasil akun. |
Menu dan layanan terkait9 kolom
data.data[].subBoxes[].items[]
| Kolom | Jenis | Deskripsi |
|---|---|---|
menus |
array | null |
Entri menu yang ditampilkan bersama hasil akun, jika ada. |
menus[] |
object |
Satu entri menu akun yang ditampilkan. |
menus[].title |
string |
Judul tampilan entri menu akun. |
menus[].accIconUrl |
string |
URL gambar ikon untuk entri menu akun. |
service |
object |
Informasi layanan terkait yang ditampilkan bersama hasil akun ini. |
service.serviceList |
array |
Layanan terkait yang dilaporkan untuk hasil akun. |
service.serviceList[] |
object |
Satu layanan terkait yang ditampilkan dalam hasil akun. |
service.serviceList[].name |
string |
Nama tampilan layanan terkait. |
service.serviceList[].desc |
string |
Teks deskripsi yang ditampilkan untuk layanan terkait. |
Contoh Respons
Memuat contoh respons...