
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
dataforseo-client
Advanced tools
API client that provide services of DataForSeo API For more information about client code generation, please follow to github
This is a TypeScript client providing you, as a developer, with a tool for obtaining the necessary data from DataForSEO APIs. You don't have to figure out how to make a request and process a response - all that is readily available in this client.
DataForSEO API uses REST technology for interchanging data between your application and our service. The data exchange is made through the widely used HTTP protocol, which allows using our API with almost any programming language.
Client contains 12 sections (aka APIs):
API Contains 2 types of requests:
For more details, please follow here
Our API description is based on the OpenAPI syntax in YAML format. The YAML file is attached to the project here
The documentation for code objects, formatted in Markdown (.md) is available here. Official documentation for DataForSEO API is available here.
Code generated using the NSwag lib
npm install dataforseo-client
Example of live request
import * as client from 'dataforseo-client'
async function main() {
const username = 'username';
const password = 'password';
const authFetch = createAuthenticatedFetch(username, password);
let serpApi = new client.SerpApi("https://api.dataforseo.com", { fetch: authFetch });
let task = new client.SerpGoogleOrganicLiveAdvancedRequestInfo();
task.location_code = 2840;
task.language_code = "en";
task.keyword = "albert einstein"
let resp = await serpApi.googleOrganicLiveAdvanced([task]);
}
function createAuthenticatedFetch(username: string, password: string) {
return (url: RequestInfo, init?: RequestInit): Promise<Response> => {
const token = btoa(`${username}:${password}`);
const authHeader = { 'Authorization': `Basic ${token}` };
const newInit: RequestInit = {
...init,
headers: {
...init?.headers,
...authHeader
}
};
return fetch(url, newInit);
};
}
main();
Example of Task based endpoint
import * as client from 'dataforseo-client'
async function main() {
const username = 'username';
const password = 'password';
const authFetch = createAuthenticatedFetch(username, password);
let serpApi = new client.SerpApi("https://api.dataforseo.com", { fetch: authFetch });
let task = new client.SerpTaskRequestInfo();
task.location_code = 2840;
task.language_code = "en";
task.keyword = "albert einstein"
let taskResponse = await serpApi.googleOrganicTaskPost([task])
let taskID = taskResponse.tasks[0].id;
const startTime = Date.now();
while (!await isReady(serpApi, taskID) && Date.now() - startTime < 60000) {
await new Promise(resolve => setTimeout(resolve, 1000));
}
let resp = await serpApi.googleOrganicTaskGetAdvanced(taskID);
}
async function isReady(serpApi: client.SerpApi, id: string): Promise<boolean> {
let resp = await serpApi.googleOrganicTasksReady();
let isReadyId = false;
resp.tasks.forEach(x => {
if (x.id == id) {
isReadyId = true;
}
});
return isReadyId;
}
function createAuthenticatedFetch(username: string, password: string) {
return (url: RequestInfo, init?: RequestInit): Promise<Response> => {
const token = btoa(`${username}:${password}`);
const authHeader = { 'Authorization': `Basic ${token}` };
const newInit: RequestInit = {
...init,
headers: {
...init?.headers,
...authHeader
}
};
return fetch(url, newInit);
};
}
main();
FAQs
API client that provide services of DataForSeo API For more information about client code generation, please follow to github
The npm package dataforseo-client receives a total of 576 weekly downloads. As such, dataforseo-client popularity was classified as not popular.
We found that dataforseo-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.