thunderer/SimilarWebApi

View on GitHub
mapping.yaml

Summary

Maintainability
Test Coverage
# Author: Tomasz Kowalczyk <tomasz@kowalczyk.cc>

# --- V0 API ------------------------------------------------------------------

GlobalRank:
  path: globalRank
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}
  values:
    rank:
      json: { field: Rank }
      xml: { field: Rank }

SimilarSites:
  path: similarSites
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}
  maps:
    similarSites:
      json: { field: SimilarSites, key: Url, value: Score }
      xml: { field: SimilarSites.SimilarSite, key: Url, value: Score }

Tagging:
  path: tags
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}
  maps:
    tags:
      json: { field: Tags, key: Name, value: Score }
      xml: { field: Tags.Tag, key: Name, value: Score }

V0WebsiteCategorization:
  path: category
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}
  values:
    category:
      json: { field: Category }
      xml: { field: Category }

WebsiteCategoryRank:
  path: categoryRank
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}
  values:
    category:
      json: { field: Category }
      xml: { field: Category }
    rank:
      json: { field: CategoryRank }
      xml: { field: CategoryRank }

WebsiteCountryRank:
  path: countryRank
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}
  maps:
    topCountryRanks:
      json: { field: TopCountryRanks, key: Code, value: Rank }
      xml: { field: TopCountryRanks.CountryRank, key: Code, value: Rank }

# --- V1 API ------------------------------------------------------------------

Traffic:
  path: v1/traffic
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}
  values:
    globalRank:
      json: { field: GlobalRank }
      xml: { field: GlobalRank }
    countryCode:
      json: { field: CountryCode }
      xml: { field: CountryCode }
    countryRank:
      json: { field: CountryRank }
      xml: { field: CountryRank }
    date:
      json: { field: Date }
      xml: { field: Date }
  maps:
    topCountryShares:
      json: { field: TopCountryShares, key: CountryCode, value: TrafficShare }
      xml: { field: TopCountryShares.Country, key: CountryCode, value: TrafficShare }
    trafficReach:
      json: { field: TrafficReach, key: Date, value: Value }
      xml: { field: TrafficReach.TrafficReachPoint, key: Date, value: Value }
    trafficShares:
      json: { field: TrafficShares, key: SourceType, value: SourceValue }
      xml: { field: TrafficShares.TrafficSource, key: SourceType, value: SourceValue }

Engagement:
  path: v1/engagement
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}
  values:
    averagePageViews:
      json: { field: AveragePageViews }
      xml: { field: AveragePageViews }
    averageTimeOnSite:
      json: { field: AverageTimeOnSite }
      xml: { field: AverageTimeOnSite }
    bounceRate:
      json: { field: BounceRate }
      xml: { field: BounceRate }
    date:
      json: { field: Date }
      xml: { field: Date }

Keywords:
  path: v1/searchintelligence
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}
  values:
    organicSearchShare:
      json: { field: OrganicSearchShare }
      xml: { field: OrganicSearchShare }
    paidSearchShare:
      json: { field: PaidSearchShare }
      xml: { field: PaidSearchShare }
    startDate:
      json: { field: StartDate }
      xml: { field: StartDate }
    endDate:
      json: { field: EndDate }
      xml: { field: EndDate }
  arrays:
    topOrganicTerms:
      json: { field: TopOrganicTerms }
      xml: { field: TopOrganicTerms.Keyword }
    topPaidTerms:
      json: { field: TopPaidTerms }
      xml: { field: TopPaidTerms.Keyword }

SocialReferrals:
  path: v1/SocialReferringSites
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}
  values:
    startDate:
      json: { field: StartDate }
      xml: { field: StartDate }
    endDate:
      json: { field: EndDate }
      xml: { field: EndDate }
  maps:
    socialSources:
      json: { field: SocialSources, key: Source, value: Value }
      xml: { field: SocialSources.Source, key: Source, value: Value }

# --- V2 API ------------------------------------------------------------------

AdultWebsites:
  path: v2/Category
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}
  values:
    category:
      json: { field: Category }
      xml: { field: Category }

AlsoVisited:
  path: v2/AlsoVisited
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}
  maps:
    alsoVisited:
      json: { field: AlsoVisited, key: Url, value: Score }
      xml: { field: AlsoVisited.AlsoVisited, key: Url, value: Score }

CategoryRank:
  path: v2/CategoryRank
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}
  values:
    category:
      json: { field: Category }
      xml: { field: Category }
    rank:
      json: { field: CategoryRank }
      xml: { field: CategoryRank }

Destinations:
  path: v2/leadingdestinationsites
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}
  values:
    startDate:
      json: { field: StartDate }
      xml: { field: StartDate }
    endDate:
      json: { field: EndDate }
      xml: { field: EndDate }
  arrays:
    sites:
      json: { field: Sites }
      xml: { field: Sites.Site }

EstimatedVisitors:
  path: v2/EstimatedTraffic
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}
  values:
    estimatedVisitors:
      json: { field: EstimatedVisitors }
      xml: { field: EstimatedVisitors }

Referrals:
  path: v2/leadingreferringsites
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}
  values:
    startDate:
      json: { field: StartDate }
      xml: { field: StartDate }
    endDate:
      json: { field: EndDate }
      xml: { field: EndDate }
  arrays:
    sites:
      json: { field: Sites }
      xml: { field: Sites.Site }

SimilarWebsites:
  path: v2/SimilarSites
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}
  maps:
    similarWebsites:
      json: { field: SimilarSites, key: Url, value: Score }
      xml: { field: SimilarSites.SimilarSite, key: Url, value: Score }

WebsiteCategorization:
  path: v2/Category
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}
  values:
    category:
      json: { field: Category }
      xml: { field: Category }

WebsiteTags:
  path: v2/Tags
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}
  maps:
    tags:
      json: { field: Tags, key: Name, value: Score }
      xml: { field: Tags.Tag, key: Name, value: Score }

# --- V1 PRO API --------------------------------------------------------------

TrafficPro:
  path: v1/visits
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}&gr={period}&start={start}&end={end}&md={main}
  maps:
    values:
      json: { field: Values, key: Date, value: Value }
      xml: { field: Values.Metric, key: Date, value: Value }

EngagementPageViews:
  path: v1/pageviews
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}&gr={period}&start={start}&end={end}&md={main}
  maps:
    values:
      json: { field: Values, key: Date, value: Value }
      xml: { field: Values.Metric, key: Date, value: Value }

EngagementVisitDuration:
  path: v1/visitduration
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}&gr={period}&start={start}&end={end}&md={main}
  maps:
    values:
      json: { field: Values, key: Date, value: Value }
      xml: { field: Values.Metric, key: Date, value: Value }

EngagementBounceRate:
  path: v1/bouncerate
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}&gr={period}&start={start}&end={end}&md={main}
  maps:
    values:
      json: { field: Values, key: Date, value: Value }
      xml: { field: Values.Metric, key: Date, value: Value }

KeywordsOrganicSearch:
  path: v1/orgsearch
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}&start={start}&end={end}&md={main}&page={page}
  values:
    results:
      json: { field: ResultsCount }
      xml: { field: ResultsCount }
    total:
      json: { field: TotalCount }
      xml: { field: TotalCount }
    next:
      json: { field: Next }
      xml: { field: Next }
  tuples:
    terms:
      json: { field: Data, index: SearchTerm, items: [{ key: Visits, value: visits }, { key: Change, value: change }] }
      xml: { field: Data.Keyword, index: SearchTerm, items: [{ key: Visits, value: visits }, { key: Change, value: change }] }

KeywordsPaidSearch:
  path: v1/paidsearch
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}&start={start}&end={end}&md={main}&page={page}
  values:
    results:
      json: { field: ResultsCount }
      xml: { field: ResultsCount }
    total:
      json: { field: TotalCount }
      xml: { field: TotalCount }
    next:
      json: { field: Next }
      xml: { field: Next }
  tuples:
    terms:
      json: { field: Data, index: SearchTerm, items: [{ key: Visits, value: visits }, { key: Change, value: change }] }
      xml: { field: Data.Keyword, index: SearchTerm, items: [{ key: Visits, value: visits }, { key: Change, value: change }] }

ReferralsPro:
  path: v1/referrals
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}&start={start}&end={end}&md={main}&page={page}
  values:
    results:
      json: { field: ResultsCount }
      xml: { field: ResultsCount }
    total:
      json: { field: TotalCount }
      xml: { field: TotalCount }
    next:
      json: { field: Next }
      xml: { field: Next }
  tuples:
    sites:
      json: { field: Data, index: Site, items: [{ key: Visits, value: visits }, { key: Change, value: change }] }
      xml: { field: Data.SiteReferral, index: Site, items: [{ key: Visits, value: visits }, { key: Change, value: change }] }

KeywordCompetitorsOrganic:
  path: v1/orgkwcompetitor
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}&start={start}&end={end}&md={main}&page={page}
  values:
    results:
      json: { field: ResultsCount }
      xml: { field: ResultsCount }
    total:
      json: { field: TotalCount }
      xml: { field: TotalCount }
    next:
      json: { field: Next }
      xml: { field: Next }
  maps:
    values:
      json: { field: Data, key: Domain, value: Score }
      xml: { field: Data.SearchCompetitor, key: Domain, value: Score }

KeywordCompetitorsPaid:
  path: v1/paidkwcompetitor
  url: /Site/{domain}/{path}?Format={format}&UserKey={token}&start={start}&end={end}&md={main}&page={page}
  values:
    results:
      json: { field: ResultsCount }
      xml: { field: ResultsCount }
    total:
      json: { field: TotalCount }
      xml: { field: TotalCount }
    next:
      json: { field: Next }
      xml: { field: Next }
  maps:
    values:
      json: { field: Data, key: Domain, value: Score }
      xml: { field: Data.SearchCompetitor, key: Domain, value: Score }

# --- MOBILE API --------------------------------------------------------------

MobileApp:
  path: v1/GetAppDetails
  url: /Mobile/{store}/{app}/{path}?Format={format}&UserKey={token}
  values:
    title:
      json: { field: Title }
      xml: { field: Title }
    cover:
      json: { field: Cover }
      xml: { field: Cover }
    author:
      json: { field: Author }
      xml: { field: Author }
    price:
      json: { field: Price }
      xml: { field: Price }
    mainCategory:
      json: { field: MainCategory }
      xml: { field: MainCategory }
    mainCategoryId:
      json: { field: MainCategoryId }
      xml: { field: MainCategoryId }
    rating:
      json: { field: Rating }
      xml: { field: Rating }

MobileAppInstalls:
  path: v1/GetAppInstalls
  url: /Mobile/{store}/{app}/{path}?Format={format}&UserKey={token}
  values:
    min:
      json: { field: InstallsMin }
      xml: { field: InstallsMin }
    max:
      json: { field: InstallsMax }
      xml: { field: InstallsMax }

MobileRelatedApps:
  path: v1/GetRelatedSiteApps
  url: /Mobile/{store}/{domain}/{path}?Format={format}&UserKey={token}
  maps:
    apps:
      json: { field: RelatedApps, key: AppId, value: Title }
      xml: { field: RelatedApps.App, key: AppId, value: Title }