{
  "openapi": "3.0.1",
  "info": {
    "title": "Telecontact Scraper",
    "description": "Scrape Moroccan businesses from Telecontact.ma (Pages Jaunes Maroc) by category and city. Get phones, fax, WhatsApp, website, address, map position, ICE, trade register, legal form, capital, size, founding year, managers, hours and social links. Optional emails. Filters, monitoring.",
    "version": "1.0",
    "x-build-id": "IFq28Kcy7gxvpPSLO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/normdata~telecontact-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-normdata-telecontact-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/normdata~telecontact-scraper/runs": {
      "post": {
        "operationId": "runs-sync-normdata-telecontact-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/normdata~telecontact-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-normdata-telecontact-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many businesses in total. Leave empty for no limit. The Apify Free plan is always capped at 10."
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Trades or categories in French, as on the site, like \"restaurant\", \"plombier\", \"avocat\" or \"pharmacie\". Each term covers every category with these words, sub-categories included (\"restaurant\" also finds \"Restaurants: cuisine marocaine\"). Empty with a city = every business in that city.",
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "Cities",
            "type": "array",
            "description": "Optional. Search only in these cities, like \"Casablanca\", \"Rabat\", \"Fès\" or \"El Jadida\". Empty = all of Morocco, read city by city when a category has more businesses than the site shows at once.",
            "items": {
              "type": "string"
            }
          },
          "includeEmails": {
            "title": "Emails from the business website",
            "type": "boolean",
            "description": "Also open each business website (home page, then its contact page) and collect the email addresses shown there. Telecontact itself shows no emails. Charged as an add-on only for businesses where emails are found."
          },
          "onlyWithPhone": {
            "title": "Only with phone",
            "type": "boolean",
            "description": "Keep only businesses that list a phone number."
          },
          "onlyWithMobile": {
            "title": "Only with mobile phone",
            "type": "boolean",
            "description": "Keep only businesses with a Moroccan mobile number (06 or 07)."
          },
          "onlyWithWhatsapp": {
            "title": "Only with WhatsApp",
            "type": "boolean",
            "description": "Keep only businesses that list a WhatsApp number."
          },
          "onlyWithWebsite": {
            "title": "Only with website",
            "type": "boolean",
            "description": "Keep only businesses that list a website."
          },
          "onlyWithEmail": {
            "title": "Only with email",
            "type": "boolean",
            "description": "Keep only businesses whose website shows an email address. Turns on the email add-on."
          },
          "onlyWithSocialMedia": {
            "title": "Only with social media",
            "type": "boolean",
            "description": "Keep only businesses that link a Facebook, Instagram, LinkedIn, YouTube, X or TikTok profile."
          },
          "onlyWithIce": {
            "title": "Only with ICE number",
            "type": "boolean",
            "description": "Keep only businesses that show their ICE (Identifiant Commun de l'Entreprise)."
          },
          "onlyWithLocation": {
            "title": "Only with map position",
            "type": "boolean",
            "description": "Keep only businesses that have a map position (latitude and longitude)."
          },
          "onlyAdvertisers": {
            "title": "Only advertisers",
            "type": "boolean",
            "description": "Keep only businesses with a paid Telecontact listing (logo, photos, hours and more details)."
          },
          "legalForms": {
            "title": "Legal forms",
            "type": "array",
            "description": "Keep only businesses with one of these legal forms.",
            "items": {
              "type": "string",
              "enum": [
                "SARL",
                "SARL AU",
                "SA",
                "SNC",
                "SCI",
                "Entreprise individuelle",
                "Other"
              ],
              "enumTitles": [
                "SARL",
                "SARL AU",
                "SA",
                "SNC",
                "SCI",
                "Entreprise individuelle",
                "Other"
              ]
            }
          },
          "employees": {
            "title": "Company size (employees)",
            "type": "array",
            "description": "Keep only businesses in one of these staff ranges. Most small businesses do not publish it.",
            "items": {
              "type": "string",
              "enum": [
                "1-9",
                "10-19",
                "20-49",
                "50-99",
                "100-249",
                "250-499",
                "500+"
              ],
              "enumTitles": [
                "1-9",
                "10-19",
                "20-49",
                "50-99",
                "100-249",
                "250-499",
                "500+"
              ]
            }
          },
          "foundedFrom": {
            "title": "Founded from (year)",
            "minimum": 1800,
            "type": "integer",
            "description": "Keep only businesses founded in this year or later, like 2020."
          },
          "foundedTo": {
            "title": "Founded until (year)",
            "minimum": 1800,
            "type": "integer",
            "description": "Keep only businesses founded in this year or earlier."
          },
          "openOn": {
            "title": "Open on these days",
            "type": "array",
            "description": "Keep only businesses whose published hours include every chosen day.",
            "items": {
              "type": "string",
              "enum": [
                "Monday",
                "Tuesday",
                "Wednesday",
                "Thursday",
                "Friday",
                "Saturday",
                "Sunday"
              ],
              "enumTitles": [
                "Monday",
                "Tuesday",
                "Wednesday",
                "Thursday",
                "Friday",
                "Saturday",
                "Sunday"
              ]
            }
          },
          "onlyNew": {
            "title": "Only new businesses",
            "type": "boolean",
            "description": "Skip businesses saved by earlier runs with the same monitor name."
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Runs with the same name share their history. Use a different name for each schedule."
          },
          "startUrls": {
            "title": "Links",
            "type": "array",
            "description": "Category pages (https://www.telecontact.ma/liens/restaurants/casablanca.php or https://www.telecontact.ma/maroc/restaurants.html) or business pages (https://www.telecontact.ma/annonceur/...).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}