ShareASale Affiliate API - Merchants & Activity (BYOC) avatar

ShareASale Affiliate API - Merchants & Activity (BYOC)

Pricing

from $2.00 / 1,000 item scrapeds

Go to Apify Store
ShareASale Affiliate API - Merchants & Activity (BYOC)

ShareASale Affiliate API - Merchants & Activity (BYOC)

Access ShareASale affiliate data via the official API (BYOC): merchants, coupons, deals and transaction activity reports for publishers. Bring your own API token.

Pricing

from $2.00 / 1,000 item scrapeds

Rating

5.0

(1)

Developer

viralanalyzer

viralanalyzer

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

19 days ago

Last modified

Share

🛒 ShareASale Affiliate API — Merchants, Coupons & Activity (BYOC)

🔗 View on Apify Store | 🇺🇸 English | 🇧🇷 Português

Query the official ShareASale Affiliate API for merchant status, merchant search, coupon deals, activity reports, payment history and banner ads. BYOC (Bring Your Own Credentials) — you supply your affiliate ID, API token and API secret; the Actor builds the HMAC signature, calls shareasale.com/x.cfm, and turns the pipe-delimited response into JSON rows.

The response columns are decided by ShareASale, not by us. Read Output to see exactly which keys the Actor guarantees and which ones pass through from the API.

✨ What each run gives you

  • 6 actions: merchantStatus, merchantSearch, couponDeals, activity, paymentHistory, bannerList
  • Version 3 auth — SHA-256 signature of token:date:action:secret in the x-ShareASale-Authentication header, so the calling IP does not need to be whitelisted (Apify IPs rotate)
  • Pipe-delimited parser — the first response line is read as the header row and every following line becomes a JSON object keyed by those headers
  • Tagged errors[SHAREASALE_API], [SHAREASALE_RATE], [INPUT] in the log, so you know whether it was auth, rate limit or your input
  • Diagnostic record instead of a FAILED run — a missing credential, an unknown action, a missing date range or zero rows produce one labeled setup_status record and the run still ends SUCCEEDED with no PPE charge

🔑 BYOC setup (one-time, ~5 min)

  1. Log in at https://shareasale.com with your affiliate account
  2. Go to Tools > Merchant Tools > API Reporting
  3. Create an API Token on Version 3 so the calling IP does not need to be whitelisted
  4. Copy your affiliateId (Account > Profile), API Token and API Secret into the Actor input

Why Version 3? Version 2 requires whitelisting every IP that calls the API. Apify runs on rotating IPs, so Version 2 would fail intermittently. The Actor sends version=3.0 on every request and signs each call with token:date:action:secret, which removes the IP requirement.

📥 Input

ParameterTypeRequiredDefaultDescription
affiliateIdstring (secret)YesYour numeric ShareASale affiliate ID
apiTokenstring (secret)YesAPI token (Version 3) from Tools > API Reporting
apiSecretstring (secret)YesAPI secret matching the token
actionenumNomerchantStatusWhich endpoint to call (see Actions table below)
keywordstringNo""Free-text keyword, sent for merchantSearch only
categorystringNo""Category filter, sent for merchantSearch only
merchantIdintegerNo0Sent for couponDeals, bannerList and activity. 0 means "no filter"
dateStartstringConditional""YYYY-MM-DD. Required for activity. Optional for paymentHistory
dateEndstringConditional""YYYY-MM-DD. Required for activity. Optional for paymentHistory
maxResultsintegerNo100Cap on rows pushed to the dataset. Values outside 1–1000 are clamped

All three credentials are checked before the first network call. If any one of them is empty, the run stops with a CREDENTIALS_REQUIRED-style diagnostic record and no charge.

Actions

ActionPurposeFilters actually sent
merchantStatusMerchants you can promote, with join statusnone
merchantSearchFind new merchantskeyword, category
couponDealsActive coupons from joined merchantsmerchantId
activitySales / leads / clicks report for a date rangedateStart, dateEnd (both required), merchantId
paymentHistoryYour payment recordsdateStart, dateEnd (both optional)
bannerListBanner ads available for promotionmerchantId

Input example

{
"affiliateId": "123456",
"apiToken": "your_api_token_here",
"apiSecret": "your_api_secret_here",
"action": "merchantSearch",
"keyword": "yoga",
"maxResults": 100
}

📤 Output

Each dataset record is an envelope of four keys the Actor always writes, plus one key per column that ShareASale returned for the chosen action.

The four guaranteed keys:

{
"action": "merchantSearch",
"affiliateId": "123456",
"scrapedAt": "2026-05-15T14:25:00+00:00",
"source": "shareasale-affiliate-api-v3"
}

source is a fixed literal, useful when you merge this dataset with other affiliate networks. action and affiliateId are echoed from your input, so rows from different runs stay distinguishable in one table.

The pass-through columns: ShareASale answers with pipe-delimited text whose first line is the header row. The Actor maps the columns positionally:

first line → columnA|columnB|columnC
data line → value1|value2|value3

becomes "columnA": "value1", "columnB": "value2", "columnC": "value3" merged into the envelope above. Three rules govern that merge:

  • Header names are taken verbatim, with spaces replaced by underscores. We do not rename, translate or reorder them. The column set depends on the action and on what ShareASale decides to return, which is why this README does not pin a fixed list.
  • Empty cells are dropped, so records from the same run can have different key sets. Zeros and the literal false are kept.
  • Every pass-through value is a string, including numeric and boolean-looking ones — the parser never casts. Cast on your side before doing arithmetic.

One consequence worth knowing: if ShareASale returns a column literally named action, affiliateId, scrapedAt or source, its value overwrites the envelope value for that record.

Diagnostic records

Recoverable problems produce one labeled record and a SUCCEEDED run with no charge:

{
"setup_status": "DIAGNOSTIC_GUIDE",
"_dataQuality": "diagnostic",
"message": "[DIAGNÓSTICO] Zero records extracted from ShareASale action='merchantSearch'.",
"potential_causes": ["The account has not joined any merchants yet (try action='merchantSearch' to discover merchants first).", "..."],
"remediations": ["Run action='merchantSearch' to find merchants you can join.", "..."],
"action": "merchantSearch",
"affiliateId": "123456",
"raw_response_bytes": 0,
"raw_response_sample": ""
}

The credential check emits the same shape with a missing_fields array instead of the raw-response keys:

{
"setup_status": "DIAGNOSTIC_GUIDE",
"_dataQuality": "diagnostic",
"message": "[DIAGNÓSTICO] Missing required ShareASale credential(s): apiSecret.",
"potential_causes": ["This is a BYOC actor — you must supply your own ShareASale API credentials.", "..."],
"remediations": ["Generate apiToken and apiSecret at shareasale.com > Tools > API Reporting.", "..."],
"missing_fields": ["apiSecret"],
"action": "merchantStatus"
}

Filter on _dataQuality == "diagnostic" to keep these out of your production tables.

📋 Use Cases

  • Niche affiliate researchmerchantSearch by keyword to find untapped programs
  • Coupon site automationcouponDeals to keep deal pages fresh
  • Performance reportingactivity over a date range for revenue dashboards
  • Payout reconciliationpaymentHistory exported to your accounting stack
  • Creative pipelinebannerList for automated banner refresh on your sites
  • Application trackingmerchantStatus to see which merchants approved or declined you

✅ Capabilities & Limits

Stated up front, so you do not pay a run to find out.

Filters are whitelisted per action before the request is signed: keyword and category go out only for merchantSearch, merchantId only for couponDeals, bannerList and activity, dates only for activity and paymentHistory, and merchantStatus sends none. Any other filter you fill in is dropped without a warning, so the run returns unfiltered rows — and bills item-scraped for every one of them.

No pagination loop: the Actor issues one HTTP GET per run and then truncates the parsed rows at maxResults. There is no page or offset cursor, so a run cannot return more than that single response contains, whatever you set maxResults to. Split large pulls across runs with different filters or date ranges.

Output columns are not a contract: the guaranteed keys are action, affiliateId, scrapedAt and source. Everything else comes from ShareASale's header row for that action and can change without any change on our side. Build your downstream schema defensively.

Heads up: this Actor needs credentials you provide yourself (affiliateId, apiToken, apiSecret). It cannot run without all three.

Input / featureSupportedNotes
affiliateId🔑 RequiredYour numeric ShareASale affiliate ID. Find it on shareasale.com > Account > Profile
apiToken🔑 RequiredAPI token from shareasale.com > Tools > API Reporting
apiSecret🔑 RequiredAPI secret matching the token. Marked isSecret, never logged
actionOne of the six values in the Actions table; anything else stops the run with a diagnostic record
keywordSent for merchantSearch only; silently ignored for every other action
categorySent for merchantSearch only; silently ignored for every other action
merchantIdSent for couponDeals, bannerList, activity; 0 disables the filter
dateStart / dateEnd⚠️Both mandatory for activity; optional for paymentHistory; ignored elsewhere
maxResults⚠️Caps the dataset, but cannot exceed the single API response (no pagination loop)
Output column names⚠️Pass-through from ShareASale; only the four envelope keys are guaranteed
Value types⚠️Pass-through values are always strings — cast before arithmetic

❓ FAQ

Q: Do I need to whitelist Apify IPs? A: No, as long as you use Version 3 credentials. The Actor signs every request with SHA-256 and sends version=3.0, so ShareASale validates by signature, not IP.

Q: Are my credentials stored? A: No. They are read from the input and passed straight to shareasale.com/x.cfm. We never persist, log or proxy them. Each user runs the Actor with their own keys.

Q: What happens when a run returns zero rows? A: The Actor writes one record with setup_status: "DIAGNOSTIC_GUIDE" and _dataQuality: "diagnostic" carrying the reason, the likely causes, the suggested fixes and a sample of the raw response body. The run ends SUCCEEDED and nothing is charged. Common causes: the account has not joined any merchant yet (use action=merchantSearch first), the activity date range is too narrow, or the action is not enabled for your tier.

Q: Which ShareASale account do I need? A: A publisher/affiliate account with API Reporting enabled. Check the current terms and any tier restrictions on ShareASale's side — this Actor only calls the API with the credentials you give it.

Q: Rate limits? A: ShareASale rate-limits per token. The Actor surfaces HTTP 429 as [SHAREASALE_RATE] including the Retry-After header value. For high volume, split runs across multiple tokens.

💰 Pricing

$0.005 per item scraped, Apify platform usage of the run is included — compute and proxy are not billed to you separately.

Pay-per-event (PPE): charged per row pushed to the dataset. The charge call runs after the zero-row check, so diagnostic-only runs cost nothing. Owner runs skip the charge.

EventCharged
item-scrapedper row pushed to dataset

📝 Changelog

v1.0 (2026-05-15)

  • Initial release covering all 6 affiliate-facing actions
  • SHA-256 Version 3 auth (no IP whitelist)
  • Pipe-delimited parser with header normalization
  • Tagged error surface ([SHAREASALE_API], [SHAREASALE_RATE], [INPUT])
  • Diagnostic record on missing credentials, unknown action, missing dates or zero rows
  • PPE charging on item-scraped with owner-skip

🛒 ShareASale API de Afiliados — Lojistas, Cupons & Relatórios (BYOC)

🔗 View on Apify Store | 🇺🇸 English | 🇧🇷 Português

Consulta a API oficial de afiliados do ShareASale para status de lojistas, busca de lojistas, cupons ativos, relatórios de atividade, histórico de pagamentos e banners. Modelo BYOC (Bring Your Own Credentials) — você fornece o ID de afiliado, o token e o secret; o Actor monta a assinatura HMAC, chama shareasale.com/x.cfm e converte a resposta pipe-delimitada em linhas JSON.

Quem decide as colunas da resposta é o ShareASale, não nós. Leia Saída para ver quais chaves o Actor garante e quais vêm direto da API.

✨ O que cada execução entrega

  • 6 ações: merchantStatus, merchantSearch, couponDeals, activity, paymentHistory, bannerList
  • Autenticação Version 3 — assinatura SHA-256 de token:data:action:secret no header x-ShareASale-Authentication, então o IP de origem não precisa de whitelist (os IPs do Apify rotacionam)
  • Parser pipe-delimitado — a primeira linha da resposta vira o cabeçalho e cada linha seguinte vira um objeto JSON com essas chaves
  • Erros tipados[SHAREASALE_API], [SHAREASALE_RATE], [INPUT] no log, para você saber se foi auth, rate limit ou input
  • Registro de diagnóstico no lugar de run FAILED — credencial ausente, ação desconhecida, faixa de datas faltando ou zero linhas geram um registro setup_status rotulado, e a execução termina SUCCEEDED sem cobrança PPE

🔑 Setup BYOC (uma vez, ~5 min)

  1. Entre em https://shareasale.com com sua conta de afiliado
  2. Vá em Tools > Merchant Tools > API Reporting
  3. Crie um API Token em Version 3 para o IP de origem não precisar de whitelist
  4. Copie o affiliateId (Account > Profile), o API Token e o API Secret no input do Actor

Por que Version 3? A Version 2 exige whitelist de cada IP que chama a API. O Apify usa IPs rotativos, então a Version 2 falharia de forma intermitente. O Actor envia version=3.0 em toda requisição e assina cada chamada com token:data:action:secret, o que elimina o requisito de IP.

📥 Entrada

ParâmetroTipoObrigatórioPadrãoDescrição
affiliateIdstring (secret)SimSeu ID numérico de afiliado no ShareASale
apiTokenstring (secret)SimToken de API (Version 3) em Tools > API Reporting
apiSecretstring (secret)SimSecret correspondente ao token
actionenumNãomerchantStatusQual endpoint chamar (veja a tabela de Ações)
keywordstringNão""Palavra-chave, enviada apenas em merchantSearch
categorystringNão""Filtro de categoria, enviado apenas em merchantSearch
merchantIdinteiroNão0Enviado em couponDeals, bannerList e activity. 0 significa "sem filtro"
dateStartstringCondicional""YYYY-MM-DD. Obrigatório em activity. Opcional em paymentHistory
dateEndstringCondicional""YYYY-MM-DD. Obrigatório em activity. Opcional em paymentHistory
maxResultsinteiroNão100Limite de linhas no dataset. Valores fora de 1–1000 são ajustados para a faixa

As três credenciais são checadas antes da primeira chamada de rede. Se qualquer uma estiver vazia, a execução para com um registro de diagnóstico e sem cobrança.

Ações

AçãoPara que serveFiltros realmente enviados
merchantStatusLojistas que você pode promover, com o status de filiaçãonenhum
merchantSearchEncontrar novos lojistaskeyword, category
couponDealsCupons ativos dos lojistas em que você já entroumerchantId
activityRelatório de vendas / leads / cliques por períododateStart, dateEnd (ambos obrigatórios), merchantId
paymentHistorySeus registros de pagamentodateStart, dateEnd (ambos opcionais)
bannerListBanners disponíveis para divulgaçãomerchantId

Exemplo de input

{
"affiliateId": "123456",
"apiToken": "your_api_token_here",
"apiSecret": "your_api_secret_here",
"action": "merchantSearch",
"keyword": "yoga",
"maxResults": 100
}

📤 Saída

Cada registro do dataset é um envelope de quatro chaves que o Actor sempre grava, mais uma chave por coluna que o ShareASale devolveu para a ação escolhida.

As quatro chaves garantidas:

{
"action": "merchantSearch",
"affiliateId": "123456",
"scrapedAt": "2026-05-15T14:25:00+00:00",
"source": "shareasale-affiliate-api-v3"
}

source é um literal fixo, útil quando você junta este dataset com o de outras redes de afiliados. action e affiliateId são ecoados do seu input, então linhas de execuções diferentes continuam distinguíveis numa tabela só.

As colunas de passagem: o ShareASale responde com texto pipe-delimitado cuja primeira linha é o cabeçalho. O Actor mapeia as colunas por posição:

primeira linha → colunaA|colunaB|colunaC
linha de dados → valor1|valor2|valor3

vira "colunaA": "valor1", "colunaB": "valor2", "colunaC": "valor3" mesclado ao envelope acima. Três regras governam essa mesclagem:

  • Os nomes do cabeçalho são copiados literalmente, trocando espaço por underscore. Nada é renomeado, traduzido ou reordenado. O conjunto de colunas depende da ação e do que o ShareASale decidir devolver — por isso este README não fixa uma lista.
  • Células vazias são descartadas, então registros da mesma execução podem ter conjuntos de chaves diferentes. Zeros e o literal false são mantidos.
  • Todo valor de passagem é string, inclusive os que parecem número ou booleano — o parser não faz cast. Converta do seu lado antes de fazer conta.

Uma consequência que vale conhecer: se o ShareASale devolver uma coluna chamada exatamente action, affiliateId, scrapedAt ou source, o valor dela sobrescreve o valor do envelope naquele registro.

Registros de diagnóstico

Problemas recuperáveis geram um registro rotulado e uma execução SUCCEEDED sem cobrança:

{
"setup_status": "DIAGNOSTIC_GUIDE",
"_dataQuality": "diagnostic",
"message": "[DIAGNÓSTICO] Zero records extracted from ShareASale action='merchantSearch'.",
"potential_causes": ["The account has not joined any merchants yet (try action='merchantSearch' to discover merchants first).", "..."],
"remediations": ["Run action='merchantSearch' to find merchants you can join.", "..."],
"action": "merchantSearch",
"affiliateId": "123456",
"raw_response_bytes": 0,
"raw_response_sample": ""
}

A checagem de credenciais emite o mesmo formato, com um array missing_fields no lugar das chaves de resposta bruta:

{
"setup_status": "DIAGNOSTIC_GUIDE",
"_dataQuality": "diagnostic",
"message": "[DIAGNÓSTICO] Missing required ShareASale credential(s): apiSecret.",
"potential_causes": ["This is a BYOC actor — you must supply your own ShareASale API credentials.", "..."],
"remediations": ["Generate apiToken and apiSecret at shareasale.com > Tools > API Reporting.", "..."],
"missing_fields": ["apiSecret"],
"action": "merchantStatus"
}

Filtre por _dataQuality == "diagnostic" para manter esses registros fora das suas tabelas de produção.

📋 Casos de Uso

  • Pesquisa de afiliados de nichomerchantSearch por keyword para encontrar programas pouco explorados
  • Sites de cupons automatizadoscouponDeals mantém páginas de ofertas atualizadas
  • Relatórios de performanceactivity por período alimenta dashboards de receita
  • Conciliação de pagamentospaymentHistory exportado direto para a contabilidade
  • Pipeline criativobannerList automatiza a atualização de banners nos seus sites
  • Acompanhamento de candidaturasmerchantStatus mostra quais lojistas aprovaram ou recusaram você

✅ Capacidades e limites

Declarado de antemão, para você não gastar uma execução descobrindo.

Filtros são liberados por ação antes da requisição ser assinada: keyword e category só saem em merchantSearch, merchantId só em couponDeals, bannerList e activity, datas só em activity e paymentHistory, e merchantStatus não envia nenhum. Qualquer outro filtro que você preencher é descartado sem aviso, então a execução devolve linhas sem filtro — e cobra item-scraped por cada uma delas.

Sem laço de paginação: o Actor faz um GET por execução e depois corta as linhas parseadas em maxResults. Não existe cursor de página ou offset, então uma execução não devolve mais do que aquela única resposta contém, por mais alto que maxResults esteja. Divida coletas grandes em execuções com filtros ou períodos diferentes.

As colunas de saída não são um contrato: as chaves garantidas são action, affiliateId, scrapedAt e source. Todo o resto vem do cabeçalho que o ShareASale devolve para aquela ação e pode mudar sem nenhuma mudança do nosso lado. Monte o schema a jusante de forma defensiva.

Atenção: este Actor exige credenciais suas (affiliateId, apiToken, apiSecret). Sem as três ele não roda.

Input / recursoSuportadoObservação
affiliateId🔑 ObrigatórioSeu ID numérico de afiliado. Está em shareasale.com > Account > Profile
apiToken🔑 ObrigatórioToken de API em shareasale.com > Tools > API Reporting
apiSecret🔑 ObrigatórioSecret correspondente ao token. Marcado como isSecret, nunca logado
actionUm dos seis valores da tabela de Ações; qualquer outro para a execução com registro de diagnóstico
keywordEnviado apenas em merchantSearch; ignorado em silêncio nas demais ações
categoryEnviado apenas em merchantSearch; ignorado em silêncio nas demais ações
merchantIdEnviado em couponDeals, bannerList, activity; 0 desliga o filtro
dateStart / dateEnd⚠️Obrigatórios em activity; opcionais em paymentHistory; ignorados no resto
maxResults⚠️Limita o dataset, mas não ultrapassa a resposta única da API (não há laço de paginação)
Nomes das colunas de saída⚠️Vêm do ShareASale; só as quatro chaves do envelope são garantidas
Tipos dos valores⚠️Valores de passagem são sempre string — converta antes de fazer conta

❓ Perguntas Frequentes

P: Preciso fazer whitelist dos IPs do Apify? R: Não, desde que use credenciais Version 3. O Actor assina cada requisição com SHA-256 e envia version=3.0, e o ShareASale valida por assinatura, não por IP.

P: Vocês armazenam minhas credenciais? R: Não. Elas são lidas do input e passadas direto para shareasale.com/x.cfm. Não persistimos, logamos nem intermediamos. Cada usuário roda o Actor com as próprias chaves.

P: O que acontece quando a execução retorna zero linhas? R: O Actor grava um registro com setup_status: "DIAGNOSTIC_GUIDE" e _dataQuality: "diagnostic" trazendo o motivo, as causas prováveis, as correções sugeridas e uma amostra do corpo bruto da resposta. A execução termina SUCCEEDED e nada é cobrado. Causas comuns: a conta ainda não entrou em nenhum lojista (use action=merchantSearch antes), a faixa de datas de activity está estreita demais, ou a ação não está habilitada no seu tier.

P: Qual conta ShareASale eu preciso? R: Uma conta de publisher/afiliado com API Reporting habilitado. Confirme os termos atuais e eventuais restrições de tier no próprio ShareASale — este Actor apenas chama a API com as credenciais que você fornece.

P: Quais limites de taxa? R: O ShareASale limita por token. O Actor expõe HTTP 429 como [SHAREASALE_RATE] com o valor do cabeçalho Retry-After. Para volume alto, divida as execuções entre vários tokens.

💰 Preços

$0.005 por item extraído, o uso de plataforma da Apify está incluído — compute e proxy não são cobrados à parte.

Pay-per-event (PPE): cobrado por linha gravada no dataset. A chamada de cobrança acontece depois da checagem de zero linhas, então execução só com diagnóstico não custa nada. Execuções do dono também pulam a cobrança.

EventoCobrança
item-scrapedpor linha gravada no dataset

🔗 Actors Relacionados

📝 Changelog

v1.0 (2026-05-15)

  • Release inicial cobrindo as 6 ações voltadas ao afiliado
  • Autenticação SHA-256 Version 3 (sem IP whitelist)
  • Parser pipe-delimitado com normalização de cabeçalho
  • Erros tipados ([SHAREASALE_API], [SHAREASALE_RATE], [INPUT])
  • Registro de diagnóstico em credencial ausente, ação desconhecida, datas faltando ou zero linhas
  • Cobrança PPE em item-scraped com owner-skip